Skip to content

Commit 1c56457

Browse files
author
Tim Helfensdörfer
committed
Fix array key when accessing zip files
closes #51
1 parent 6439f5b commit 1c56457

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AutoUpdate.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ protected function install(string $updateFile, bool $simulateInstall, string $ve
804804
// Read every file from archive
805805
for ($i = 0; $i < $zip->numFiles; $i++) {
806806
$fileStats = $zip->statIndex($i);
807-
$filename = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $fileStats['filename']);
807+
$filename = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $fileStats['name']);
808808
$foldername = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR,
809809
$this->installDir . dirname($filename));
810810
$absoluteFilename = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->installDir . $filename);
@@ -822,8 +822,8 @@ protected function install(string $updateFile, bool $simulateInstall, string $ve
822822
}
823823

824824
// Extract file
825-
if ($zip->extractTo($absoluteFilename, $fileStats['filename']) === false) {
826-
$this->log->error(sprintf('Coud not read zip entry "%s"', $fileStats['filename']));
825+
if ($zip->extractTo($absoluteFilename, $fileStats['name']) === false) {
826+
$this->log->error(sprintf('Coud not read zip entry "%s"', $fileStats['name']));
827827
continue;
828828
}
829829

0 commit comments

Comments
 (0)