Check for ORIG_PATH_INFO on IIS. props brh, fixes #5160

git-svn-id: http://svn.automattic.com/wordpress/trunk@6203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2007-10-08 20:48:29 +00:00
parent 8ff0a0659a
commit c10999aec9
1 changed files with 6 additions and 2 deletions

View File

@ -38,8 +38,12 @@ if ( empty( $_SERVER['REQUEST_URI'] ) ) {
}
else {
// 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'], '/')) . '/';
if (empty($_SERVER['PATH_INFO'])) {
if (isset($_SERVER['ORIG_PATH_INFO']))
$_SERVER['REQUEST_URI'] = $_SERVER['ORIG_PATH_INFO'];
else
$_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'];