From 1c56457afaa6c0016e270c9ce3af51fc301c912c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Helfensd=C3=B6rfer?= Date: Thu, 16 Sep 2021 19:15:22 +0200 Subject: [PATCH] Fix array key when accessing zip files closes #51 --- src/AutoUpdate.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AutoUpdate.php b/src/AutoUpdate.php index 67f70e4..1ba32e1 100755 --- a/src/AutoUpdate.php +++ b/src/AutoUpdate.php @@ -804,7 +804,7 @@ protected function install(string $updateFile, bool $simulateInstall, string $ve // Read every file from archive for ($i = 0; $i < $zip->numFiles; $i++) { $fileStats = $zip->statIndex($i); - $filename = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $fileStats['filename']); + $filename = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $fileStats['name']); $foldername = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->installDir . dirname($filename)); $absoluteFilename = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->installDir . $filename); @@ -822,8 +822,8 @@ protected function install(string $updateFile, bool $simulateInstall, string $ve } // Extract file - if ($zip->extractTo($absoluteFilename, $fileStats['filename']) === false) { - $this->log->error(sprintf('Coud not read zip entry "%s"', $fileStats['filename'])); + if ($zip->extractTo($absoluteFilename, $fileStats['name']) === false) { + $this->log->error(sprintf('Coud not read zip entry "%s"', $fileStats['name'])); continue; }