Issues

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

Issue Type: Bug Created: 2008-09-15T12:53:47.000+0000 Last Updated: 2008-10-10T14:41:46.000+0000 Status: Resolved Fix version(s): - 1.6.2 (13/Oct/08)

Reporter: Daniel Thomas (dpool) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate_File

Related issues: Attachments:

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

Posted by Thomas Weidner (thomas) on 2008-09-19T06:13:30.000+0000

Fixed with r11432

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts