Permalink
Browse files

Merge pull request #1010 from baldurrensch/zip_error_check

Added a check for the return code when extracting zip file
  • Loading branch information...
2 parents 750fda9 + 1398757 commit 43fa5d5c40793d48feae22ee79e123be760ad2dc @Seldaek Seldaek committed Aug 18, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Composer/Downloader/ZipDownloader.php
@@ -54,7 +54,10 @@ protected function extract($file, $path)
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();
}

0 comments on commit 43fa5d5

Please sign in to comment.