[HttpFoundation] fixed PHP warnings
This commit is contained in:
parent
410d39963b
commit
cf71e226b8
@ -91,7 +91,7 @@ class JsonResponse extends Response
|
|||||||
public function setData($data = array())
|
public function setData($data = array())
|
||||||
{
|
{
|
||||||
// Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML.
|
// 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()) {
|
if (JSON_ERROR_NONE !== json_last_error()) {
|
||||||
throw new \InvalidArgumentException($this->transformJsonError());
|
throw new \InvalidArgumentException($this->transformJsonError());
|
||||||
|
Reference in New Issue
Block a user