Skip to content

Commit

Permalink
Fixed the problem of insert failure due to non-utf8 content. (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
guandeng authored May 7, 2024
1 parent 43ddf74 commit 52db24d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/IncomingEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,15 @@ public function familyHash(): ?string
*/
public function toArray(): array
{
$content = json_decode(json_encode($this->content, JSON_INVALID_UTF8_SUBSTITUTE), true);

return [
'uuid' => $this->uuid,
'batch_id' => $this->batchId,
'sub_batch_id' => $this->subBatchId,
'family_hash' => $this->familyHash,
'type' => $this->type,
'content' => $this->content,
'content' => $content ?: [],
'created_at' => $this->recordedAt,
];
}
Expand Down

0 comments on commit 52db24d

Please sign in to comment.