[eluser]StickGrinder[/eluser]
Just in case someone else has this error and above solutions don't work:
I'm running CI 2.1 (vanilla) on PHP 5.3.10 - (mod_php, Ubuntu server) and the error persists.
Figured out that in system/libraries/Upload.php, from line 597 the following code
Code:
$ext = strtolower(ltrim($this->file_ext, '.'));
if ( ! in_array($ext, $this->allowed_types))
{
return FALSE;
}
invariabily fails, since for what I think is a bug in PHP, $ext value before the if statement is correct, while after the if statement (and during it, it seems), it changes.
To check this out try this:
Code:
$ext = strtolower(ltrim($this->file_ext, '.'));
echo var_dump($ext);
if ( ! in_array($ext, $this->allowed_types))
{
die(var_dump($ext));
return FALSE;
}
Changing the variable name to $fext across all class did the trick for me: the value remains untouched.
EDIT: I lied! It fails equally. The ONLY viable solution I found is to use a constant instead. AWFUL solution follows!
Code:
define('ULFEXT', strtolower(ltrim($this->file_ext, '.')));
if ( ! in_array(ULFEXT, $this->allowed_types))
{
return FALSE;
}
$ext = ULFEXT;
Thanks PHP. And if someone is thinking about testing out some other framework, my advice is to frog-leap to another language too.

meh.