ZF-9706: Zend_Controller_Router_Route don't handle array parameters with wildcard routes
Description
To reproduce this isuue, make route like this
resources.router.routes.cars.route = "auto-oglasi/*" resources.router.routes.cars.defaults.module = "default" resources.router.routes.cars.defaults.controller = "auto-oglasi" resources.router.routes.cars.defaults.action = "index"
This works as expected, unless you work with array notation URLs, like /auto-oglasi/price/0/price/1000/year/1984/year/2010 In such case parameters become strings, instead arrayas, so price will have value "0", year "1984", etc..
I think this is a bug in Zend_Controller_Router_Route, because it treats parameters as strings, and get only first value, ignoring others
if (!isset($this->_wildcardData[$var]) && !isset($this->_defaults[$var]) && !isset($values[$var])) {
$this->_wildcardData[$var] = (isset($path[$i+1])) ? urldecode($path[$i+1]) : null;
}
Comments
Posted by Sasa Stamenkovic (umpirsky) on 2010-04-19T00:54:33.000+0000
Here is a fix suggestion, it would be nice to have this resolved in current bug hunt days ;)
Posted by Jonny White (jonny-white) on 2011-04-20T12:06:34.000+0000
The Suggested diff got me part way there on this one but didn't work for anything more than 2 items in the array. I've changed one line which seems to work very well. http://pastie.org/1815135