Zend Framework

IIS7 ignores blank key/value pairs

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.9.3
  • Component/s: Zend_Controller
  • Labels:
    None

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.

  1. web.config
    18/Sep/09 1:04 PM
    2 kB
    Henry Umansky
  2. ZF-7767.patch
    18/Sep/09 1:09 PM
    1.0 kB
    Ralph Schindler

Activity

Hide
Ralph Schindler added a comment -

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

Show
Ralph Schindler added a comment - 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
Hide
Henry Umansky added a comment -

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

Show
Henry Umansky added a comment - 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
Hide
Ralph Schindler added a comment -

Patch attched

Show
Ralph Schindler added a comment - Patch attched
Hide
Ralph Schindler added a comment -

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

-ralph

Show
Ralph Schindler added a comment - Hey Henry, can you test the patch I've provided up above and let me know if it works for you? -ralph
Hide
Ralph Schindler added a comment -

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

Show
Ralph Schindler added a comment - Fixed in trunk in r18308 and in release branch 1.9 in r18310
Hide
Henry Umansky added a comment -

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

Show
Henry Umansky added a comment - Works like a charm.......thank you Ralph!!!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: