From ea023fcf17e1c0bf925e2874335e495fc64747ea Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 15 Aug 2019 21:54:50 -0600 Subject: [PATCH] Update ImportCities command, check for corrupt or invalid checksum --- app/Console/Commands/ImportCities.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Console/Commands/ImportCities.php b/app/Console/Commands/ImportCities.php index 157e3d416..a5f36fcbe 100644 --- a/app/Console/Commands/ImportCities.php +++ b/app/Console/Commands/ImportCities.php @@ -60,6 +60,15 @@ class ImportCities extends Command public function handle() { $path = storage_path('app/cities.json'); + + if(hash_file('sha512', $path) !== 'e203c0247538788b2a91166c7cf4b95f58291d998f514e9306d315aa72b09e48bfd3ddf310bf737afc4eefadca9083b8ff796c67796c6bd8e882a3d268bd16af') { + $this->error('Invalid or corrupt storage/app/cities.json data.'); + $this->line(''); + $this->info('Run the following command to fix:'); + $this->info('git checkout storage/app/cities.json'); + return; + } + if (!is_file($path)) { $this->error('Missing storage/app/cities.json file!'); return;