Skip to content

Commit

Permalink
Fix REQUEST_URI construction for IIS. Bug 389. Patch from Dennis Will…
Browse files Browse the repository at this point in the history
…iamson.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
rboren committed Oct 22, 2004
1 parent fdfcddb commit 12b4069
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wp-settings.php
Expand Up @@ -4,7 +4,12 @@
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */

// Fix for IIS, which doesn't set REQUEST_URI
$_SERVER['REQUEST_URI'] = ( isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME'] . (( isset($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '')));
$_SERVER['REQUEST_URI'] = (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']);

// Append the query string if it exists and isn't null
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}

if ( !(phpversion() >= '4.1') )
die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' );
Expand Down

0 comments on commit 12b4069

Please sign in to comment.