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: http://svn.automattic.com/wordpress/trunk@6058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ead6bfebf7
commit
6a1c63e2f7
|
@ -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'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue