Explorar o código

Added a check for the return code when extracting zip file

Baldur Rensch %!s(int64=13) %!d(string=hai) anos
pai
achega
1398757963
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/Composer/Downloader/ZipDownloader.php

+ 4 - 1
src/Composer/Downloader/ZipDownloader.php

@@ -54,7 +54,10 @@ class ZipDownloader extends ArchiveDownloader
             throw new \UnexpectedValueException($this->getErrorMessage($retval, $file));
         }
 
-        $zipArchive->extractTo($path);
+        if (true !== $zipArchive->extractTo($path)) {
+            throw new \RuntimeException("There was an error extracting the ZIP file. Corrupt file?");
+        }
+
         $zipArchive->close();
     }