diff options
author | Andrey Andreev <narf@devilix.net> | 2014-06-03 14:40:30 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-06-03 14:40:30 +0200 |
commit | 1f5090acda137edb29cc649d85c7ef1b75b8f59f (patch) | |
tree | 6cb461e74dddda46be0d28399cb7a1e4389637ab | |
parent | f9201ae527d2c321976658f5c360f7127faa414c (diff) |
Fix a potential undefined variable error
-rw-r--r-- | system/helpers/file_helper.php | 2 | ||||
-rw-r--r-- | system/libraries/Zip.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 8cfe0f1c1..8fdb5f7cc 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -80,7 +80,7 @@ if ( ! function_exists('write_file')) flock($fp, LOCK_EX); - for ($written = 0, $length = strlen($data); $written < $length; $written += $result) + for ($result = $written = 0, $length = strlen($data); $written < $length; $written += $result) { if (($result = fwrite($fp, substr($data, $written))) === FALSE) { diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index ab30a9019..62a84ae75 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -405,7 +405,7 @@ class CI_Zip { flock($fp, LOCK_EX); - for ($written = 0, $data = $this->get_zip(), $length = strlen($data); $written < $length; $written += $result) + for ($result = $written = 0, $data = $this->get_zip(), $length = strlen($data); $written < $length; $written += $result) { if (($result = fwrite($fp, substr($data, $written))) === FALSE) { |