فهرست منبع

Merge pull request #1010 from baldurrensch/zip_error_check

Added a check for the return code when extracting zip file
Jordi Boggiano 13 سال پیش
والد
کامیت
43fa5d5c40
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();
     }