ZF-3527: Zend_Controller_Request_Http url encoded BASE_URL


In Zend_Controller_Request_Http

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


 return $this->_requestUri;

should be

return urldecode($this->_requestUri);


Fix and Tests

Waiting to be patched.

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

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

Fixed in r23365 in trunk and release branch 1.11 at 23369

This change breaks backward compatibility.

Test case:

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);

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

Recent patch fixes issue ZF-11017 as well

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.

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

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

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