From 1e25c5bece7ebb60ca46a332e019db700d26e365 Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 30 Jan 2006 01:14:21 +0000 Subject: [PATCH] - We don't use the extra info because we can extrapolate the only thing of use (attributes) by using logic. Thus, we can skip large amounts of the file without missing any information. git-svn-id: file:///svn/phpbb/trunk@5511 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_compress.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index c99328f54c..2d226aefa2 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -238,13 +238,10 @@ class compress_zip extends compress fclose($fp); break; - // 'Central Directory Header' + // We hit the 'Central Directory Header', we can stop because nothing else in here requires our attention + // or we hit the end of the central directory record, we can safely end the loop as we are totally finished with looking for files and folders case "\x50\x4b\x01\x02": - fseek($this->fp, 24, SEEK_CUR); - fseek($this->fp, 12 + current(unpack("v", fread($this->fp, 2))) + current(unpack("v", fread($this->fp, 2))) + current(unpack("v", fread($this->fp, 2))), SEEK_CUR); - break; - - // Hit the end of the central directory record, we can safely end the loop as we are totally finished with looking for files and folders + // This case should simply never happen.. but it does exist.. case "\x50\x4b\x05\x06": break 2;