This commit is contained in:
Nicolas Grekas 2016-01-13 08:28:48 +01:00
parent 36eb8188ca
commit c5479dde8c

View File

@ -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