Issues

ZF-4298: Validation against file extensions in Zend_Validate_File_Extension fails if the filename contains a Dot "."

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

Comments

Fixed with r11432