Skip to content

Commit

Permalink
Merge pull request #100 from fitztrev/patch-1
Browse files Browse the repository at this point in the history
Make sure zip file is valid before extracting
  • Loading branch information
taylorotwell authored Oct 17, 2019
2 parents d255663 + 2f2c5cc commit 6e5472e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ protected function extract($zipFile, $directory)
{
$archive = new ZipArchive;

$archive->open($zipFile);
$response = $archive->open($zipFile, ZipArchive::CHECKCONS);

if ($response === ZipArchive::ER_NOZIP) {
throw new RuntimeException('The zip file could not download. Verify that you are able to access: http://cabinet.laravel.com/latest.zip');
}

$archive->extractTo($directory);

Expand Down

0 comments on commit 6e5472e

Please sign in to comment.