From 6c312afe9b4d23c85154d4b8854c42bceb94861d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 16 Oct 2003 08:12:40 +0000 Subject: [PATCH] Calculate offset progressively (patch #824122). --- ChangeLog | 3 +++ libraries/zip.lib.php3 | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7289208dc..79cd26fee 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-10-10 Michal Cihar + * libraries/zip.lib.php3: Calculate offset progressively (patch #824122). + 2003-10-15 Marc Delisle * lang/russian-windows-1251: wrong charset (bug 823939) diff --git a/libraries/zip.lib.php3 b/libraries/zip.lib.php3 index 3c8e8248f..5918c1fdd 100755 --- a/libraries/zip.lib.php3 +++ b/libraries/zip.lib.php3 @@ -130,7 +130,6 @@ class zipfile // add this entry to array $this -> datasec[] = $fr; - $new_offset = strlen(implode('', $this->datasec)); // now add to central directory record $cdrec = "\x50\x4b\x01\x02"; @@ -150,7 +149,7 @@ class zipfile $cdrec .= pack('V', 32 ); // external file attributes - 'archive' bit set $cdrec .= pack('V', $this -> old_offset ); // relative offset of local header - $this -> old_offset = $new_offset; + $this -> old_offset += strlen($fr); $cdrec .= $name;