summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Upload.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 9d2bae2ae..fa1cf1e73 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -477,17 +477,28 @@ class CI_Upload {
*/
function is_image()
{
+ // IE will sometimes return odd mime-types during upload, so here we just standardize all
+ // jpegs or pngs to the same file type.
+
+ $png_mimes = array('image/x-png');
+ $jpeg_mimes = array('image/jpg', 'image/jpe', 'image/jpeg', 'image/pjpeg');
+
+ if (in_array($this->file_type, $png_mimes))
+ {
+ $this->file_type = 'image/png';
+ }
+
+ if (in_array($this->file_type, $jpeg_mimes))
+ {
+ $this->file_type = 'image/jpeg';
+ }
+
$img_mimes = array(
'image/gif',
- 'image/jpg',
- 'image/jpe',
'image/jpeg',
- 'image/pjpeg',
'image/png',
- 'image/x-png'
);
-
return (in_array($this->file_type, $img_mimes, TRUE)) ? TRUE : FALSE;
}