minor #17346 [2.3] Workaround https://bugs.php.net/63206 (nicolas-grekas)
This PR was merged into the 2.3 branch.
Discussion
----------
[2.3] Workaround https://bugs.php.net/63206
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This bug has almost no chance to be hit in this code but still, cleaning any potential issue is worth.
Commits
-------
c5479dd
[2.3] Workaround https://bugs.php.net/63206
This commit is contained in:
commit
7a02f4e43e
@ -106,7 +106,7 @@ class JsonResponse extends Response
|
|||||||
// PHP 5.3 triggers annoying warnings for some
|
// PHP 5.3 triggers annoying warnings for some
|
||||||
// types that can't be serialized as JSON (INF, resources, etc.)
|
// types that can't be serialized as JSON (INF, resources, etc.)
|
||||||
// but doesn't provide the JsonSerializable interface.
|
// but doesn't provide the JsonSerializable interface.
|
||||||
set_error_handler('var_dump', 0);
|
set_error_handler(function () { return false; });
|
||||||
$data = @json_encode($data, $this->encodingOptions);
|
$data = @json_encode($data, $this->encodingOptions);
|
||||||
} else {
|
} else {
|
||||||
// PHP 5.4 and up wrap exceptions thrown by JsonSerializable
|
// PHP 5.4 and up wrap exceptions thrown by JsonSerializable
|
||||||
|
Reference in New Issue
Block a user