Merge pull request #3432 from stof/patch-1
Fixed the json formatting when using JSONCpull/3442/head
commit
533eeddcb7
|
@ -187,7 +187,7 @@ class JsonFile
|
||||||
$json = json_encode($data, $options);
|
$json = json_encode($data, $options);
|
||||||
|
|
||||||
// compact brackets to follow recent php versions
|
// compact brackets to follow recent php versions
|
||||||
if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512)) {
|
if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512) || (defined('JSON_C_VERSION') && version_compare(phpversion('json'), '1.3.6', '<'))) {
|
||||||
$json = preg_replace('/\[\s+\]/', '[]', $json);
|
$json = preg_replace('/\[\s+\]/', '[]', $json);
|
||||||
$json = preg_replace('/\{\s+\}/', '{}', $json);
|
$json = preg_replace('/\{\s+\}/', '{}', $json);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue