ZF-11496: Regex routes in chains fail to urldecode parameters


When using a Regex Route as part of a Chain (the Regex Route becomes a partial), the parameters belonging to the Regex Route do not get urldecoded.

The following test case does pass in 1.11.5 and before. Since 1.11.6., the third assertion fails

class ZendTest extends PHPUnit_Framework_TestCase {

    public function testRegexInChainUrlDecode() {
        $router = new Zend_Controller_Router_Rewrite();
        $foo = new Zend_Controller_Router_Route_Regex(
            array('first' => 1),
        $router->addRoute('foo', $foo);
        $bar = new Zend_Controller_Router_Route(':action/');
        $router->addRoute('bar', $bar);
        $chain = new Zend_Controller_Router_Route_Chain();
        $router->addRoute('chain', $chain);

            $router->assemble(array('first' => 'a', 'action' => 'go'), 'chain', true),
            'assembling with all parameters given'

        $request = new Zend_Controller_Request_Http('http://host/foo_a/go');
        $matchedRoute = $router->route($request);

            array('first' => 'a', 'action' => 'go'),
            'matching simple url'

        $request = new Zend_Controller_Request_Http('http://host/foo_lorem+ipsum/go');
        $matchedRoute = $router->route($request);

            array('first' => 'lorem ipsum', 'action' => 'go'),
            $matchedRoute->getParams(),  // sadly gives us "lorem+ipsum"
            'matching url with url-encoded "first" parmeter'


No comments to display