EllisLab/CodeIgniter — Issue #764: error in  checking for mime type in Upload library
Author: niranjnn01
Created: 2011-12-10 07:44:55+00:00
State: open

Trim function must be applied on Line number 200 of Upload class

$this->file_type = trim( preg_replace("/^(.+?);.*$/", "\\1", $this->file_type) );

Or else,

The following code segment will always be bypassed inside the "is_allowed_filetype()" function , and Hence will always return false. (there was an extra space to the right of file_type, in my case)

if (is_array($mime))
{
if (in_array($this->file_type, $mime, TRUE))
{
return TRUE;
}
}
elseif ($mime == $this->file_type)
{
return TRUE;
}