Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update JsonResponse.php
Added JSON_NUMERIC_CHECK flag to fix issues when json response is used in JavaScript apps and especially in AngularJS.
  • Loading branch information
esgy authored and fabpot committed Jul 8, 2013
1 parent ea468a2 commit 218bb90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/JsonResponse.php
Expand Up @@ -83,7 +83,7 @@ public function setCallback($callback = null)
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 | JSON_NUMERIC_CHECK);

return $this->update();
}
Expand Down

0 comments on commit 218bb90

Please sign in to comment.