Преглед изворни кода

Add workaround for PHP bug #61336

Jordi Boggiano пре 13 година
родитељ
комит
a4f9e03d35
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      src/Composer/Util/RemoteFilesystem.php

+ 5 - 0
src/Composer/Util/RemoteFilesystem.php

@@ -108,6 +108,11 @@ class RemoteFilesystem
             $result = @file_get_contents($fileUrl, false, $ctx);
         }
 
+        // fix for 5.4.0 https://bugs.php.net/bug.php?id=61336
+        if (!empty($http_response_header[0]) && preg_match('{^HTTP/\S+ 404}i', $http_response_header[0])) {
+            $result = false;
+        }
+
         // avoid overriding if content was loaded by a sub-call to get()
         if (null === $this->result) {
             $this->result = $result;