From 64270523e95c2bd6e09f61e0bee1477f618b2dc7 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Mon, 8 Oct 2007 20:48:29 +0000 Subject: [PATCH] Check for ORIG_PATH_INFO on IIS. props brh, fixes #5160 git-svn-id: https://develop.svn.wordpress.org/trunk@6203 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-settings.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-settings.php b/wp-settings.php index 215dd63744..b263317d92 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -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'];