From 12b406941ae3787b6ce2a0039bd5453d84b1efd8 Mon Sep 17 00:00:00 2001 From: rboren Date: Fri, 22 Oct 2004 18:07:29 +0000 Subject: [PATCH] Fix REQUEST_URI construction for IIS. Bug 389. Patch from Dennis Williamson. git-svn-id: http://svn.automattic.com/wordpress/trunk@1827 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-settings.php b/wp-settings.php index 98cc1d04f8..627dbb7e68 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -4,7 +4,12 @@ $REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */ $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' );