Explorar o código

Restrict the JSONC fix to affected versions

Christophe Coevoet %!s(int64=10) %!d(string=hai) anos
pai
achega
c571ccafd3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Composer/Json/JsonFile.php

+ 1 - 1
src/Composer/Json/JsonFile.php

@@ -187,7 +187,7 @@ class JsonFile
             $json = json_encode($data, $options);
 
             //  compact brackets to follow recent php versions
-            if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512) || defined('JSON_C_VERSION')) {
+            if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512) || (defined('JSON_C_VERSION') && version_compare(php_version('json'), '1.3.6', '<'))) {
                 $json = preg_replace('/\[\s+\]/', '[]', $json);
                 $json = preg_replace('/\{\s+\}/', '{}', $json);
             }