Issues

ZF-7246: Zend_Controller_Router_Rewrite should not use array_merge in assemble

Description

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


 $params = array_merge($this->_globalParams, $userParams);

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

A common example would be:

 
echo $this->view->url(array('4'=>'M', 'page'=>2)); 
or
$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().

Comments

Assigning to Ben

Resolving as duplicate. See ZF-8914