Skip to content

Commit

Permalink
Merge pull request #565 from nextcloud/fix-extractdownload-zip-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Jun 3, 2024
2 parents 439340f + ed1c2b5 commit 9965212
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions lib/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Binary file modified updater.phar
Binary file not shown.

0 comments on commit 9965212

Please sign in to comment.