Permalink
Browse files

Added a check for the return code when extracting zip file

  • Loading branch information...
1 parent 7b3ce47 commit 1398757963a161ce5553d37433f59e180edc5d77 Baldur Rensch committed Aug 17, 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 1398757

Please sign in to comment.