We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 837020c + 99a65a8 commit 5093694Copy full SHA for 5093694
1 file changed
system/Format/JSONFormatter.php
@@ -56,13 +56,13 @@ class JSONFormatter implements FormatterInterface
56
*/
57
public function format($data)
58
{
59
- $options = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES;
+ $options = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR;
60
61
$options = ENVIRONMENT === 'production' ? $options : $options | JSON_PRETTY_PRINT;
62
63
$result = json_encode($data, $options, 512);
64
65
- if (json_last_error() !== JSON_ERROR_NONE)
+ if ( ! in_array(json_last_error(), [JSON_ERROR_NONE, JSON_ERROR_RECURSION]))
66
67
throw FormatException::forInvalidJSON(json_last_error_msg());
68
}
0 commit comments