Closed (won't fix)
Project:
IMCE
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2007 at 12:44 UTC
Updated:
15 Mar 2011 at 07:18 UTC
"Invalid filename." error is shown when a valid filename is uploaded. We are using PHP 5.2.1 and mysql5. It seems that the problem is on line 240:
$file['name'] = substr($file['name'], -48); //max filename lenght is 48
The substr returns and empty string when then length of the filename is less than 48, and therefore the error is raised.
On PHP 5.2.0 works perfectly, but in 5.2.1 not. It may be an undocumented change or bug on this release of PHP.
Comments
Comment #1
ufku commentednot verified! and since it seems to be related to a certain php version it is not critical.
a quickfix for the ones having the issue could be changing the buggy line with:
$file['name'] = strlen($file['name'])>48 ? substr($file['name'], -48) : $file['name'];
patch comes later.
thanks juanval.
Comment #2
ufku commentedthis was reported many times and fixed in a lately submitted issue.
Comment #3
giorgoskOK that fix was still needed for my current installation of
imce 5.x-1.x-dev
drupal 5.10
PHP 5.2.6
Comment #4
ufku commented