8000 merged branch esgy/patch-1 (PR #8420) · symfony/symfony@af31180 · GitHub
[go: up one dir, main page]

Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}

Commit af31180

Browse files
committed
merged branch esgy/patch-1 (PR #8420)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8420). Discussion ---------- Update JsonResponse.php Added JSON_NUMERIC_CHECK flag to fix issues when json response is used in JavaScript apps and especially in AngularJS. Commits ------- 2b1c973 Update JsonResponse.php
2 parents ea468a2 + 218bb90 commit af31180

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpFoundation/JsonResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function setCallback($callback = null)
8383
public function setData($data = array())
8484
{
8585
// Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML.
86-
$this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
86+
$this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_NUMERIC_CHECK);
8787

8888
return $this->update();
8989
}

0 commit comments

Comments
 (0)
0