Skip to content

Commit

Permalink
Merge pull request #80 from 4513/main
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 16, 2024
2 parents 40edd32 + 4dfed80 commit b5051e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Saver/FileSaver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ public function isSupported()

public function save(array $data)
{
$json = json_encode($data);
$json = json_encode($data, PHP_VERSION_ID >= 70200 ? JSON_INVALID_UTF8_IGNORE : 0);

if ($json === false) {
return false;
}

return file_put_contents($this->file, $json . PHP_EOL, FILE_APPEND);
}
Expand Down
7 changes: 6 additions & 1 deletion src/Saver/UploadSaver.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public function isSupported()

public function save(array $data)
{
$json = json_encode($data);
$json = json_encode($data, PHP_VERSION_ID >= 70200 ? JSON_INVALID_UTF8_IGNORE : 0);

if ($json === false) {
return false;
}

$this->submit($this->url, $json);

return true;
Expand Down

0 comments on commit b5051e9

Please sign in to comment.