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

Issue Type: Bug Created: 2011-06-20T14:04:06.000+0000 Last Updated: 2011-06-20T14:04:06.000+0000 Status: Open Fix version(s): Reporter: Pablo Grass (grass) Assignee: Ben Scholzen (dasprid) Tags: - Zend_Controller_Router

Related issues: Attachments:


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

<pre class="literal"> 
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('<a href="http://host/foo_a/go">http://host/foo_a/go</a>');
        $matchedRoute = $router->route($request);

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

        $request = new Zend_Controller_Request_Http('<a href="http://host/foo_lorem+ipsum/go">http://host/foo_lorem+ipsum/go</a>');
        $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

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.