Explorar o código

Ensure opening the zip was successful before proceeding

Kristof Ringleff, Fooman %!s(int64=6) %!d(string=hai) anos
pai
achega
bcf4e94e8a
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/Composer/Repository/ArtifactRepository.php

+ 5 - 1
src/Composer/Repository/ArtifactRepository.php

@@ -126,7 +126,11 @@ class ArtifactRepository extends ArrayRepository implements ConfigurableReposito
     private function getComposerInformation(\SplFileInfo $file)
     {
         $zip = new \ZipArchive();
-        $zip->open($file->getPathname());
+        $res = $zip->open($file->getPathname());
+
+        if ($res !== true) {
+            return false;
+        }
 
         if (0 == $zip->numFiles) {
             $zip->close();