ZF-2782: Zend_Controller_Request_Http setPathInfo breaks with %20 in url

Description

Between 1.0.3 and 1.0.4/1.5RC1 the setRequestUri method (lines 328-258) in Zend_Controller_Request_Http has added a urldecode($requestUri) call (line 356) but not had this reflected in the setPathInfo method (lines 525-551) around the baseUrl when doing the substr (lin 540).

Example that breaks this: Any Url with %20 in it.

Fix - change (lines 539 - 541):


            if ((null !== $baseUrl)
                && (false === ($pathInfo = substr($requestUri, strlen($baseUrl)))))
            {

to:


            if ((null !== $baseUrl)
                && (false === ($pathInfo = substr($requestUri, strlen(urldecode($baseUrl))))))
            {

Comments

This issue is related to ZF-2052, and I plan to revert the change for that issue as it appears to break more things than it fixes.

Scheduling for 1.5.0RC2

Fixed in trunk; will merge to release branch shortly.

Resolved with r8576