summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorRick Ellis <rick.ellis@ellislab.com>2007-06-11 06:35:52 +0200
committerRick Ellis <rick.ellis@ellislab.com>2007-06-11 06:35:52 +0200
commit64bbd04d8a3c92e577254513504e9c9d617fe676 (patch)
treeb88dc1735db3bd7f9f7ca15d3c05c8e0127c7da2 /system
parent70d5463ec2c7599d8234e224fdf2fd5a10f1c99f (diff)
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);