summaryrefslogtreecommitdiffstats
path: root/system/libraries/Zip.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-15 16:51:58 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-15 16:51:58 +0100
commit60f71be48a6b91cc314908c3c0007f13e9cb2f0a (patch)
treec7eb0d43c976984303886503781e0fcae0f0949a /system/libraries/Zip.php
parent9916bfc126b0d6efa337740b263f123c5367fc55 (diff)
parentd8b1ad31cf7ee205ddf3cf396b1d1bfa45af49fa (diff)
Merge changes from develop
Diffstat (limited to 'system/libraries/Zip.php')
-rw-r--r--system/libraries/Zip.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index 250ee02cd..b10b0bb0f 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -403,11 +403,19 @@ class CI_Zip {
}
flock($fp, LOCK_EX);
- fwrite($fp, $this->get_zip());
+
+ for ($written = 0, $data = $this->get_zip(), $length = strlen($data); $written < $length; $written += $result)
+ {
+ if (($result = fwrite($fp, substr($data, $written))) === FALSE)
+ {
+ break;
+ }
+ }
+
flock($fp, LOCK_UN);
fclose($fp);
- return TRUE;
+ return is_int($result);
}
// --------------------------------------------------------------------