From ed1c2b5592d21260c3490b36e16bcea07f6c9385 Mon Sep 17 00:00:00 2001 From: Josh Richards Date: Thu, 23 May 2024 16:06:22 -0400 Subject: [PATCH] fix(extractDownload): Check for presence of zip extension + log Libzip version detected Signed-off-by: Josh Richards --- index.php | 7 +++++++ lib/Updater.php | 7 +++++++ updater.phar | Bin 1172822 -> 1173106 bytes 3 files changed, 14 insertions(+) diff --git a/index.php b/index.php index 84cb41e8..429358dc 100644 --- a/index.php +++ b/index.php @@ -751,6 +751,13 @@ public function extractDownload(): void { $this->silentLog('[info] extractDownload()'); $downloadedFilePath = $this->getDownloadedFilePath(); + if (!extension_loaded('zip')) { + throw new \Exception('Required PHP extension missing: zip'); + } + + $libzip_version = defined("ZipArchive::LIBZIP_VERSION") ? \ZipArchive::LIBZIP_VERSION : "Unknown (but old)"; + $this->silentLog('[info] Libzip version detected: ' . $libzip_version); + $zip = new \ZipArchive; $zipState = $zip->open($downloadedFilePath); if ($zipState === true) { diff --git a/lib/Updater.php b/lib/Updater.php index 9ee2d5ce..a7e61722 100644 --- a/lib/Updater.php +++ b/lib/Updater.php @@ -713,6 +713,13 @@ public function extractDownload(): void { $this->silentLog('[info] extractDownload()'); $downloadedFilePath = $this->getDownloadedFilePath(); + if (!extension_loaded('zip')) { + throw new \Exception('Required PHP extension missing: zip'); + } + + $libzip_version = defined("ZipArchive::LIBZIP_VERSION") ? \ZipArchive::LIBZIP_VERSION : "Unknown (but old)"; + $this->silentLog('[info] Libzip version detected: ' . $libzip_version); + $zip = new \ZipArchive; $zipState = $zip->open($downloadedFilePath); if ($zipState === true) { diff --git a/updater.phar b/updater.phar index 50e18c9804e664e2f919f1dae1b12631ef07504c..919ebdb461fc469d4d42ad8ef5201e3a09585b98 100755 GIT binary patch delta 5887 zcma)Ad3Y36wx8FD-d#WKk-{&8%|2VhKIlr^q zbI)DA{`lRh?~hcqZ4`?d>kFs(^E|%BM&A?L^MA{KJ^D918qU-+TTpX(KBYzFMU-9| zl#Wi7IrOhvD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