$_SERVER['REQUEST_URI'] is not available using IIS with rewrite rules, so use HTTP_X_...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sun, 11 Apr 2010 15:38:58 +0000 (15:38 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sun, 11 Apr 2010 15:38:58 +0000 (15:38 +0000)
includes/Setup.php

index cd9146a..b37fb5e 100644 (file)
@@ -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";