ZF-9973: Zend_Controller_Router_Route::assemble with translation does wrong check on default values


There is a little bug in Zend_Controller_Router_Route::assemble() method, when you have default values and using translation feature. Currently it will produce full length url when assembling even though specified paramters are equal to default paramters. This is because in line 394, there is a wrong check and so the translated value is compared against the not translated value. (and so the parameter always gets added to url)

So please change this (line 394-396)

{quote} if ($this->_isTranslated && $defaultValue !== null && isset($this->_translatable[$this->_variables[$key]])) { $defaultValue = $translator->translate($defaultValue, $locale); } {quote}

to this

{quote} if ($this->_isTranslated && $defaultValue !== null && in_array($this->_variables[$key], $this->_translatable)) { $defaultValue = $translator->translate($defaultValue, $locale); } {quote}


No comments to display