From 1ca5718fc6c02a89c194d6482f23e41c193bfd33 Mon Sep 17 00:00:00 2001 From: Andrés Ignacio Torres Date: Mon, 27 Jan 2020 14:37:24 -0400 Subject: optimize memory allocation on zip library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrés Ignacio Torres --- system/libraries/Zip.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 094f4c802..5fba1cf3a 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -406,13 +406,13 @@ class CI_Zip { return FALSE; } - return $this->zipdata - .$this->directory."\x50\x4b\x05\x06\x00\x00\x00\x00" + $footer = $this->directory."\x50\x4b\x05\x06\x00\x00\x00\x00" .pack('v', $this->entries) // total # of entries "on this disk" .pack('v', $this->entries) // total # of entries overall .pack('V', self::strlen($this->directory)) // size of central dir .pack('V', self::strlen($this->zipdata)) // offset to start of central dir ."\x00\x00"; // .zip file comment length + return $this->zipdata . $footer; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b