datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
948 B
25 lines
948 B
6 years ago
|
Index: vendor/laravel/framework/src/Illuminate/Support/Collection.php
|
||
|
IDEA additional info:
|
||
|
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||
|
<+>UTF-8
|
||
|
===================================================================
|
||
|
--- vendor/laravel/framework/src/Illuminate/Support/Collection.php (revision )
|
||
|
+++ vendor/laravel/framework/src/Illuminate/Support/Collection.php (revision )
|
||
|
@@ -1736,7 +1736,15 @@
|
||
|
*/
|
||
|
public function toJson($options = 0)
|
||
|
{
|
||
|
- return json_encode($this->jsonSerialize(), $options);
|
||
|
+ // Patch to convert INF or NAN to null.
|
||
|
+ $serialized = $this->jsonSerialize();
|
||
|
+ $resp = json_encode($serialized, $options);
|
||
|
+ if (json_last_error() == JSON_ERROR_INF_OR_NAN) {
|
||
|
+ $resp = json_encode(unserialize(
|
||
|
+ str_replace(array('d:NAN;','d:INF;'), 'd:0;', serialize($serialized))
|
||
|
+ ), $options);
|
||
|
+ }
|
||
|
+ return $resp;
|
||
|
}
|
||
|
|
||
|
/**
|