From 715e685546d34a60d52ed370099130c343896ba4 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sun, 11 Apr 2010 15:38:58 +0000 Subject: [PATCH] $_SERVER['REQUEST_URI'] is not available using IIS with rewrite rules, so use HTTP_X_ORIGINAL_URL as alternative. --- includes/Setup.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/Setup.php b/includes/Setup.php index cd9146ab9d..b37fb5e0c8 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -182,7 +182,12 @@ if ( $wgCommandLineMode ) { wfDebug( "\n\nStart command line script $self\n" ); } else { wfDebug( "Start request\n\n" ); - wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" ); + # Output the REQUEST_URI. This is not supported by IIS in rewrite mode, + # so use an alternative + $requestUri = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : + ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ? $_SERVER['HTTP_X_ORIGINAL_URL'] : + $_SERVER['PHP_SELF'] ); + wfDebug( "{$_SERVER['REQUEST_METHOD']} {$requestUri}\n" ); if ( $wgDebugPrintHttpHeaders ) { $headerOut = "HTTP HEADERS:\n"; -- 2.20.1