We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 79c6ad2 + 5b06fd9 commit 95fd1b0Copy full SHA for 95fd1b0
application/libraries/Format.php
@@ -403,14 +403,14 @@ public function to_json($data = NULL)
403
404
if (empty($callback) === TRUE)
405
{
406
- return json_encode($data);
+ return json_encode($data, JSON_NUMERIC_CHECK);
407
}
408
409
// We only honour a jsonp callback which are valid javascript identifiers
410
elseif (preg_match('/^[a-z_\$][a-z0-9\$_]*(\.[a-z_\$][a-z0-9\$_]*)*$/i', $callback))
411
412
// Return the data as encoded json with a callback
413
- return $callback.'('.json_encode($data).');';
+ return $callback.'('.json_encode($data, JSON_NUMERIC_CHECK).');';
414
415
416
// An invalid jsonp callback function provided.
0 commit comments