浏览代码

Avoid escaping slashes and unicode for nothing

Jordi Boggiano 7 年之前
父节点
当前提交
0dfbf11b35
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/Packagist/WebBundle/Package/SymlinkDumper.php

+ 3 - 3
src/Packagist/WebBundle/Package/SymlinkDumper.php

@@ -542,7 +542,7 @@ class SymlinkDumper
             }
         }
 
-        $json = json_encode($this->rootFile);
+        $json = json_encode($this->rootFile, JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
         $time = time();
 
         $this->writeFile($file, $json, $time);
@@ -558,7 +558,7 @@ class SymlinkDumper
         // sort files to make hash consistent
         ksort($this->listings[$key]['providers']);
 
-        $json = json_encode($this->listings[$key]);
+        $json = json_encode($this->listings[$key], JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
         $hash = hash('sha256', $json);
         $path = substr($path, 0, -5) . '$' . $hash . '.json';
         $time = time();
@@ -609,7 +609,7 @@ class SymlinkDumper
 
         $this->fs->mkdir(dirname($path));
 
-        $json = json_encode($this->individualFiles[$key]);
+        $json = json_encode($this->individualFiles[$key], JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
         $this->writeFile($path, $json, $this->individualFilesMtime[$key]);
 
         // write the hashed provider file