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
This commit is contained in:
rboren 2004-10-22 18:07:29 +00:00
parent fdfcddbaf7
commit 12b406941a

View File

@ -4,7 +4,12 @@ $REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */ $HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */
// Fix for IIS, which doesn't set REQUEST_URI // 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') ) if ( !(phpversion() >= '4.1') )
die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' ); die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' );