ZF-7246: Zend_Controller_Router_Rewrite should not use array_merge in assemble

Issue Type: Bug Created: 2009-07-11T17:41:43.000+0000 Last Updated: 2010-11-29T00:49:24.000+0000 Status: Resolved Fix version(s): Reporter: Virgil Daniel Ratiu (vratiu) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Controller

Related issues: - ZF-8914



Zend_Controller_Router_Rewrite::assemble is currently using array_merge to merge user provided parameters and global parameters.

<pre class="highlight">
 $params = array_merge($this->_globalParams, $userParams);

This way user provided parameters that contain numeric keys are reset/changed

A common example would be:

<pre class="highlight"> 
echo $this->view->url(array('4'=>'M', 'page'=>2)); 
$router = new Zend_Controller_Router_Rewrite();
echo $router->assemble (array('4'=>'M', 'page'=>2));

will return "/index/index/0/M/page/2" expecting: "/index/index/4/M/page/2"

Should use the "+" operator or a function that can merge arrays and preserve numeric keys like the one used in Zend_Controller_Router_Route_Regex::_arrayMergeNumericKeys().


Posted by Matthew Weier O'Phinney (matthew) on 2009-07-11T19:10:03.000+0000

Assigning to Ben

Posted by Ramon Henrique Ornelas (ramon) on 2010-11-29T00:49:24.000+0000

Resolving as duplicate. See ZF-8914

Have you found an issue?

See the Overview section for more details.


© 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.