ZF-7767: IIS7 ignores blank key/value pairs

Issue Type: Bug Created: 2009-09-03T10:46:11.000+0000 Last Updated: 2009-09-21T06:39:18.000+0000 Status: Resolved Fix version(s): - 1.9.3 (22/Sep/09)

Reporter: Henry Umansky (humansky) Assignee: Ralph Schindler (ralph) Tags: - Zend_Controller

Related issues: Attachments: - web.config


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.


Posted by Ralph Schindler (ralph) on 2009-09-18T08:47:13.000+0000

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

Posted by Henry Umansky (humansky) on 2009-09-18T13:04:45.000+0000

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.


Posted by Ralph Schindler (ralph) on 2009-09-18T13:09:07.000+0000

Patch attched

Posted by Ralph Schindler (ralph) on 2009-09-18T14:18:26.000+0000

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


Posted by Ralph Schindler (ralph) on 2009-09-19T10:50:32.000+0000

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

Posted by Henry Umansky (humansky) on 2009-09-21T06:39:14.000+0000

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

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.