diff options
author | Timothy Warren <tim@timshomepage.net> | 2012-03-01 15:40:37 +0100 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2012-03-01 15:40:37 +0100 |
commit | a0da0b28bdb0ff73d5c0d9f8780ab0f6d74f39e3 (patch) | |
tree | 67b3789312fb4056352d83432c60644648c9feac /system/libraries/Upload.php | |
parent | 7842b1bc8cc007521dcc55de613d6e3224cfe2c1 (diff) | |
parent | ed7408282e9fded97ade222f98b43623a0f17d22 (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into firebird
Diffstat (limited to 'system/libraries/Upload.php')
-rw-r--r-- | system/libraries/Upload.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 0b853233d..ac29c1bdd 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -1,4 +1,4 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * @@ -593,16 +593,17 @@ class CI_Upload { /** * Verify that the filetype is allowed * + * @param bool * @return bool */ public function is_allowed_filetype($ignore_mime = FALSE) { - if ($this->allowed_types == '*') + if ($this->allowed_types === '*') { return TRUE; } - if (count($this->allowed_types) == 0 OR ! is_array($this->allowed_types)) + if ( ! is_array($this->allowed_types) OR count($this->allowed_types) === 0) { $this->set_error('upload_no_file_types'); return FALSE; @@ -618,12 +619,9 @@ class CI_Upload { // Images get some additional checks $image_types = array('gif', 'jpg', 'jpeg', 'png', 'jpe'); - if (in_array($ext, $image_types)) + if (in_array($ext, $image_types) && @getimagesize($this->file_temp) === FALSE) { - if (getimagesize($this->file_temp) === FALSE) - { - return FALSE; - } + return FALSE; } if ($ignore_mime === TRUE) @@ -640,7 +638,7 @@ class CI_Upload { return TRUE; } } - elseif ($mime == $this->file_type) + elseif ($mime === $this->file_type) { return TRUE; } |