Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

[2.1][File Upload] Change file upload filtering to preserve the $_FILES array #3246

Merged

Conversation

cgmartin
Copy link
Contributor

Prior to these changes, the \Zend\InputFilter\FileInput would pull out the $file['tmp_name'] and pass that value along through the $filterChain->filter($tmp_name). This had the unfortunate affect of losing the $_FILES data when doing a $form->getData() - only the 'tmp_name' value would be returned for file inputs.

The PR changes \Zend\InputFilter\FileInput so that the $_FILES array data is sent through the filter chain, and the \Zend\Filter\File filters now accept an array of $_FILES data or a file path string (without any BC). $form->getData() will also return the expected $_FILES array for any file inputs.

Also patched the FilePostRedirectGet controller plugin, which was affected by these changes.

@weierophinney weierophinney merged commit 02702ec into zendframework:develop Dec 19, 2012
@ghost ghost assigned weierophinney Dec 19, 2012
kbabioch pushed a commit to kbabioch/zf2 that referenced this pull request Dec 19, 2012
weierophinney added a commit to zendframework/zend-inputfilter that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-filter that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants