Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Zend_Validate_File_Extension: Undefined index: extension #287

Closed
larsnystrom opened this Issue Feb 25, 2014 · 0 comments

Comments

Projects
None yet
2 participants

I'm using Zend Framework 1.12.3.

Zend_Validate_File_Extension::isValid() doesn't check that $info['extension'] is set before giving it to strtolower() on line 207. The $info array comes from pathinfo() on line 198.

pathinfo() do not guarantee that the extension index will be set according to the PHP manual:
http://se2.php.net/pathinfo#example-2422

You have to check that the extension index exist before using it.

This bug breaks my application in debug mode due to PHP Notices sent in a json-response.

@froschdesign froschdesign added this to the 1.12.4 milestone Feb 25, 2014

@froschdesign froschdesign self-assigned this Feb 25, 2014

@froschdesign froschdesign modified the milestones: 1.12.5, 1.12.4 Mar 7, 2014

akrabat added a commit to akrabat/zf1 that referenced this issue Mar 7, 2014

Check that pathinfo() has returned an extension
Prevent the notice that is generated when pathinfo() doesn't return an
'extension' element in Zend_Validate_File_Extension.

Fixes #287

@froschdesign froschdesign closed this in #294 Mar 7, 2014

froschdesign added a commit that referenced this issue Mar 7, 2014

Merge pull request #294 from akrabat/issue-287
Fixes #287 - Check that pathinfo() has returned an extension

xopherdeep pushed a commit to xopherdeep/Zend-Framework-v1 that referenced this issue Jul 3, 2014

Check that pathinfo() has returned an extension
Prevent the notice that is generated when pathinfo() doesn't return an
'extension' element in Zend_Validate_File_Extension.

Fixes #287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment