Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Zend_Validate_File_Extension: Undefined index: extension #287

Closed
larsnystrom opened this issue Feb 25, 2014 · 0 comments · Fixed by #294
Closed

Zend_Validate_File_Extension: Undefined index: extension #287

larsnystrom opened this issue Feb 25, 2014 · 0 comments · Fixed by #294
Assignees
Milestone

Comments

@larsnystrom
Copy link

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
Prevent the notice that is generated when pathinfo() doesn't return an
'extension' element in Zend_Validate_File_Extension.

Fixes zendframework#287
froschdesign added a commit that referenced this issue Mar 7, 2014
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
Prevent the notice that is generated when pathinfo() doesn't return an
'extension' element in Zend_Validate_File_Extension.

Fixes zendframework#287
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants