From cf71e226b83b2aa332d5bd4effdc2375296b44fb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 31 Dec 2013 17:19:37 +0100 Subject: [PATCH] [HttpFoundation] fixed PHP warnings --- src/Symfony/Component/HttpFoundation/JsonResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/JsonResponse.php b/src/Symfony/Component/HttpFoundation/JsonResponse.php index 6dfa75cd2d..1f4f0dd570 100644 --- a/src/Symfony/Component/HttpFoundation/JsonResponse.php +++ b/src/Symfony/Component/HttpFoundation/JsonResponse.php @@ -91,7 +91,7 @@ class JsonResponse extends Response public function setData($data = array()) { // Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML. - $this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); + $this->data = @json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); if (JSON_ERROR_NONE !== json_last_error()) { throw new \InvalidArgumentException($this->transformJsonError());