Check if PATH_INFO is set to avoid undefined index errors. see #5160

git-svn-id: https://develop.svn.wordpress.org/trunk@7757 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-04-21 17:35:20 +00:00
parent 83027973d1
commit e572783991
1 changed files with 6 additions and 4 deletions

View File

@ -69,10 +69,12 @@ if ( empty( $_SERVER['REQUEST_URI'] ) ) {
else
{
// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
else
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
if ( isset($_SERVER['PATH_INFO']) ) {
if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
else
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
}
// Append the query string if it exists and isn't null
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {