ZF-3527: Zend_Controller_Request_Http url encoded BASE_URL

Issue Type: Patch Created: 2008-06-27T05:45:23.000+0000 Last Updated: 2011-05-04T17:50:28.000+0000 Status: Resolved Fix version(s): - 1.11.6 (05/May/11)

Reporter: alexandru duduta (controloru) Assignee: Ralph Schindler (ralph) Tags: - Zend_Controller

Related issues: - ZF-10787

Attachments: - ZF-3527-fix.diff


In Zend_Controller_Request_Http

<pre class="highlight">
public function getRequestUri()
        if (empty($this->_requestUri)) {

        return $this->_requestUri;

if the BASE_URL is encoded the name of the module, controller is not correct Let's say that we have the following URL


which is encoded to


the module name is not ok


<pre class="highlight">
 return $this->_requestUri;

should be

<pre class="highlight">
return urldecode($this->_requestUri);


Posted by A.J. Brown (ajbrown) on 2010-04-15T14:39:45.000+0000

Fix and Tests

Posted by A.J. Brown (ajbrown) on 2010-04-15T14:40:52.000+0000

Waiting to be patched.

Posted by A.J. Brown (ajbrown) on 2010-06-16T10:45:16.000+0000

Sorry, this was sitting as In Progress instead of "Resolved".

Posted by A.J. Brown (ajbrown) on 2010-06-16T10:45:55.000+0000

Re-opening, since the patch hasn't actually been applied yet.

Posted by Ralph Schindler (ralph) on 2010-11-18T11:59:02.000+0000

Fixed in r23365 in trunk and release branch 1.11 at 23369

Posted by Artiom Lunev (_artiom) on 2010-12-06T09:49:02.000+0000

This change breaks backward compatibility.

Test case:

<pre class="highlight">
public function testPathInfoShouldNotDecodeRequestParams()
    $request = new Zend_Controller_Request_Http();
    $_SERVER['REQUEST_URI'] = '/module/controller/action/param/escaped%2Fstring';
    $pathInfo = $request->getPathInfo();

    $this->assertEquals( '/module/controller/action/param/escaped%2Fstring', $pathInfo, $pathInfo);

Posted by Jonathan Dunn (jmd) on 2010-12-06T10:15:04.000+0000

also reported in

Posted by Artiom Lunev (_artiom) on 2010-12-15T18:18:53.000+0000

Recent change to 1.11.1 brakes applications that send / as encoded parameter to action. Attaching patch with tests.

Posted by Martin Stricker (strickr) on 2011-02-01T15:10:08.000+0000

Recent patch fixes issue ZF-11017 as well

Posted by Bradley Holt (bradley.holt) on 2011-02-02T07:30:58.000+0000

Once this issue is resolved, please run the unit tests for ZF-10964 (there is a group by the same name) or all of the Zend_Rest tests. I've made some changes there that may need to be reverted depending on the fix here.

Posted by Holger Schletz (hschletz) on 2011-04-29T18:09:30.000+0000

According to the comments, the patch appears to work, which I can confirm. Any reason why there has been no progress since?

Posted by Ralph Schindler (ralph) on 2011-05-04T17:03:00.000+0000

Potential fix in trunk at r24002 - asking for watchers to test now.

Posted by Ralph Schindler (ralph) on 2011-05-04T17:50:28.000+0000

Fixed in trunk at r24002 Fixed in release branch 1.11 at r24003

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.