Skip to content

Commit

Permalink
Fix array key when accessing zip files
Browse files Browse the repository at this point in the history
closes #51
  • Loading branch information
thelfensdrfer committed Sep 16, 2021
1 parent 6439f5b commit 1c56457
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/AutoUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit 1c56457

Please sign in to comment.