From 44a736f74bd6a7852cba442e5ad4126068caf626 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 27 Apr 2007 17:03:10 +0000 Subject: modified _add_data() to be compatible with OS X (removed CRC and length from end of file stream) --- system/libraries/Zip.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 377c38741..518c97836 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -156,7 +156,7 @@ class CI_Zip { $crc32 = crc32($data); $gzdata = gzcompress($data); - $gzdata = substr(substr($gzdata, 0, strlen($gzdata) - 4), 2); + $gzdata = substr($gzdata, 2, -4); $newlen = strlen($gzdata); $this->zipdata[] = "\x50\x4b\x03\x04\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00" @@ -166,10 +166,7 @@ class CI_Zip { .pack('v', strlen($filepath)) .pack('v', 0) .$filepath - .$gzdata - .pack('V', $crc32) - .pack('V', $newlen) - .pack('V', $oldlen); + .$gzdata; $newoffset = strlen(implode("", $this->zipdata)); -- cgit v1.2.3-24-g4f1b