From 1398757963a161ce5553d37433f59e180edc5d77 Mon Sep 17 00:00:00 2001 From: Baldur Rensch Date: Fri, 17 Aug 2012 13:06:58 -0700 Subject: [PATCH] Added a check for the return code when extracting zip file --- src/Composer/Downloader/ZipDownloader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Composer/Downloader/ZipDownloader.php b/src/Composer/Downloader/ZipDownloader.php index b438ec204..79f636b55 100644 --- a/src/Composer/Downloader/ZipDownloader.php +++ b/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(); }