8000 Update JsonResponse.php · symfony/symfony@2b1c973 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2b1c973

Browse files
committed
Update JsonResponse.php
Added JSON_NUMERIC_CHECK flag to fix issues when json response is used in JavaScript apps and especially in AngularJS.
1 parent afd79ea commit 2b1c973

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
@@ -89,7 +89,7 @@ public function setCallback($callback = null)
8989
public function setData($data = array())
9090
{
9191
// Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML.
92-
$this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
92+
$this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_NUMERIC_CHECK);
9393

9494
return $this->update();
9595
}

0 commit comments

Comments
 (0)
0