Use JSON_NUMERIC_CHECK for json_encode()
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 21 Aug 2011 04:29:09 +0000 (00:29 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 21 Aug 2011 04:29:09 +0000 (00:29 -0400)
http/output_filter.php

index 5f702ac2dcb3d1cebff6d2050e9186a2f715cc50..45aba4831c22e6acca0b084499dca7c16c7a582e 100644 (file)
@@ -123,7 +123,7 @@ class OutputFilter
 
     if ($type == 'json') {
       $response->headers['Content-Type'] = 'application/json';
-      $response->body = json_encode($response->data);
+      $response->body = json_encode($response->data, JSON_NUMERIC_CHECK);
     } else if ($type == 'xml') {
       $response->headers['Content-Type'] = 'application/xml';
       $response->body = $this->_EncodeXML($response->data);