From 64bbd04d8a3c92e577254513504e9c9d617fe676 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 11 Jun 2007 04:35:52 +0000 Subject: --- system/libraries/Upload.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'system/libraries/Upload.php') 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); -- cgit v1.2.3-24-g4f1b