瀏覽代碼

Added a check for the return code when extracting zip file

Baldur Rensch 13 年之前
父節點
當前提交
1398757963
共有 1 個文件被更改,包括 4 次插入1 次删除
  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();
     }