Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.6.0
-
Fix Version/s: 1.6.2
-
Component/s: Zend_Validate_File
-
Labels:None
Description
Validation against file extensions in Zend_Validate_File_Extension fails if the filename contains a Dot "."
More specific: In function isValid of Class Zend_Validate_File_Extension in line 166 the substring operation is set on the FIRST occurance of "." and not on the last. If the filename is filename.1.jpg a file extension "1.jpg" is defined for checking against allowed extensions. This will fail.
Changing line 166 for
$info['extension'] = substr($file['name'], strpos($file['name'], '.') + 1);
to
$info['extension'] = substr($file['name'], strrpos($file['name'], '.') + 1);
Solves the problem.
Best Regards
Fixed with r11432