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

Commit

Permalink
Merge branch 'hotfix/3510' into develop
Browse files Browse the repository at this point in the history
Close #3510
Fixes #3370
  • Loading branch information
weierophinney committed Jan 22, 2013
2 parents aa22c2b + 0054079 commit 2adf713
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php
Expand Up @@ -17,6 +17,7 @@
use Zend\InputFilter\InputFilterInterface; use Zend\InputFilter\InputFilterInterface;
use Zend\Mvc\Exception\RuntimeException; use Zend\Mvc\Exception\RuntimeException;
use Zend\Session\Container; use Zend\Session\Container;
use Zend\Stdlib\ArrayUtils;
use Zend\Validator\ValidatorChain; use Zend\Validator\ValidatorChain;


/** /**
Expand Down Expand Up @@ -80,19 +81,19 @@ function($input, $value) {
// Run the form validations/filters and retrieve any errors // Run the form validations/filters and retrieve any errors
$postFiles = $request->getFiles()->toArray(); $postFiles = $request->getFiles()->toArray();
$postOther = $request->getPost()->toArray(); $postOther = $request->getPost()->toArray();
$post = array_merge($postOther, $postFiles); $post = ArrayUtils::merge($postOther, $postFiles);


$form->setData($post); $form->setData($post);
$isValid = $form->isValid(); $isValid = $form->isValid();
$data = $form->getData(Form::VALUES_AS_ARRAY); $data = $form->getData(Form::VALUES_AS_ARRAY);
$errors = (!$isValid) ? $form->getMessages() : null; $errors = (!$isValid) ? $form->getMessages() : null;


// Loop through data and merge previous files with new valid files // Loop through data and merge previous files with new valid files
$postFiles = array_merge( $postFiles = ArrayUtils::merge(
$previousFiles, $previousFiles,
$this->filterInvalidFileInputPostData($inputFilter, $data) $this->filterInvalidFileInputPostData($inputFilter, $data)
); );
$post = array_merge($post, $postFiles); $post = ArrayUtils::merge($post, $postFiles);


// Save form data in session // Save form data in session
$container->setExpirationHops(1, array('post', 'errors', 'isValid')); $container->setExpirationHops(1, array('post', 'errors', 'isValid'));
Expand Down

0 comments on commit 2adf713

Please sign in to comment.