Revert r104659 and its followup r104665: break the unit tests with a fatal error...
[lhc/web/wiklou.git] / includes / WebRequest.php
index d0430b9..9f6d277 100644 (file)
@@ -96,6 +96,16 @@ class WebRequest {
                                // Raw PATH_INFO style
                                $matches = self::extractTitle( $path, "$wgScript/$1" );
 
+                               if( !$matches
+                                       && isset( $_SERVER['SCRIPT_NAME'] )
+                                       && preg_match( '/\.php5?/', $_SERVER['SCRIPT_NAME'] ) )
+                               {
+                                       # Check for SCRIPT_NAME, we handle index.php explicitly
+                                       # But we do have some other .php files such as img_auth.php
+                                       # Don't let root article paths clober the parsing for them
+                                       $matches = self::extractTitle( $path, $_SERVER['SCRIPT_NAME'] . "/$1" );
+                               }
+
                                global $wgArticlePath;
                                if( !$matches && $wgArticlePath ) {
                                        $matches = self::extractTitle( $path, $wgArticlePath );