From e12f64e70fad08c02668ab2fda00cd5d56b8116b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 22:55:08 -0600 Subject: updating Upload features and use of security library --- system/libraries/Upload.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 5ff478269..ac9323c08 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -454,6 +454,11 @@ class CI_Upload { */ function set_allowed_types($types) { + if ( ! is_array($types) && $types == '*') + { + $this->allowed_types = '*'; + return; + } $this->allowed_types = explode('|', $types); } @@ -551,6 +556,11 @@ class CI_Upload { */ function is_allowed_filetype() { + if ($this->allowed_types == '*') + { + return TRUE; + } + if (count($this->allowed_types) == 0 OR ! is_array($this->allowed_types)) { $this->set_error('upload_no_file_types'); @@ -805,7 +815,7 @@ class CI_Upload { } $CI =& get_instance(); - $data = $CI->input->xss_clean($data); + $data = $CI->security->xss_clean($data); flock($fp, LOCK_EX); fwrite($fp, $data); -- cgit v1.2.3-24-g4f1b