From 25facccea103bf086cd53ede74d37a9ced30ce32 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Fri, 7 Sep 2007 02:43:00 +0000 Subject: [PATCH] Correctly set REQUEST_URI for IIS setups that put that info into SCRIPT_NAME as well as PATH_INFO. props snakefoot and Nazgul. fixes #4853 git-svn-id: https://develop.svn.wordpress.org/trunk@6058 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-settings.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-settings.php b/wp-settings.php index 50ce6f189c..3fe18b386f 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -40,6 +40,9 @@ if ( empty( $_SERVER['REQUEST_URI'] ) ) { // If root then simulate that no script-name was specified if (empty($_SERVER['PATH_INFO'])) $_SERVER['REQUEST_URI'] = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')) . '/'; + elseif ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) + // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice) + $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO']; else $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];