ZF-7767: IIS7 ignores blank key/value pairs

Description

I had to convert a ZF application that sat on a Linux/Apache machine to a Windows 2008/IIS7 machine. Everything seemed to work, with one minor exception. Using the LAMP stack, if the URL had a blank value, such as /index/index/key1//key2// then the PHP variables are blank:

$key1 = $request->getParam ( 'key1' ); //$key1 == '' (blank) $key2 = $request->getParam ( 'key2' ); //$key2 == '' (blank)

However, since I moved to IIS7, /index/index/key1//key2// gives me the following values:

$key1 = $request->getParam ( 'key1' ); //$key1 == 'key2' (not desired behavior) $key2 = $request->getParam ( 'key2' ); //$key2 == '' (blank)

I fixed it by overwriting the REQUEST_URI Server in my bootstrap file with the following code:

if (isset($_SERVER["IIS_WasUrlRewritten"])) { $_SERVER['REQUEST_URI'] = $_SERVER["UNENCODED_URL"]; }

Please let me know if you would like me to send you my php.ini file or any other IIS related file.

Comments

Can you tell me how you have your project setup? Which url rewriter, rules, etc? I have IIS7 installed on vista (should effectively be the same I would think)

Thanks! Ralph

Hello Ralph, I've attached my web.config file, hopefully that will help. There is nothing special about my settings, I just installed the PHP binary and everything else, I believe, should be the default. If you need anything else, please let me know.

-Henry

Patch attched

Hey Henry, can you test the patch I've provided up above and let me know if it works for you?

-ralph

Fixed in trunk in r18308 and in release branch 1.9 in r18310

Works like a charm.......thank you Ralph!!!