summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Upload.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 4cea9cd71..d8a8f69a7 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -708,19 +708,21 @@ class CI_Upload {
{
return FALSE;
}
-
+
+ if ( ! $data = file_get_contents($file))
+ {
+ return FALSE;
+ }
+
if ( ! $fp = @fopen($file, 'r+b'))
{
return FALSE;
}
-
- flock($fp, LOCK_EX);
- $data = fread($fp, filesize($file));
-
$CI =& get_instance();
$data = $CI->input->xss_clean($data);
-
+
+ flock($fp, LOCK_EX);
fwrite($fp, $data);
flock($fp, LOCK_UN);
fclose($fp);