The "request_uri" function in bootstrap.inc does not work correctly under IIS 5 (Windows 2000).

I've hacked the function as follows so that it responds correctly. Without this fix, form actions are blank, which IIS does not deal well with. The fix is probably incomplete and/or inelegant, but it works.

Jeff Bellsey

/**
 * Since request_uri() is only available on Apache, we generate an
 * equivalent using other environment vars.
 */
function request_uri() {

	// fixed for IIS
	$uri = $_SERVER['SCRIPT_NAME'];
	if ($_SERVER['QUERY_STRING'] != '') {
		$uri .= '?'.$_SERVER['QUERY_STRING'];
	}
	$_SERVER['REQUEST_URI'] = $REQUEST_URI;

/*
  if (isset($_SERVER['REQUEST_URI'])) {
    $uri = $_SERVER['REQUEST_URI'];
  }
  else {
    if (isset($_SERVER['argv'])) {
      $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0];
    }
    else {
      $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'];
    }
  }
*/

Comments

Uwe Hermann’s picture

Can somebody with IIS please test if this still applies to HEAD?

killes@www.drop.org’s picture

Status: Active » Fixed

I suppose that got fixed somehow, otherwise we'd see more reports like this. Maybe you need a more recent Drupal, though.

Anonymous’s picture

Status: Fixed » Closed (fixed)