* (bug 11428) Allow $wgScript inside $wgArticlePath when emulating PATH_INFO
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 2 Jan 2008 20:26:06 +0000 (20:26 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 2 Jan 2008 20:26:06 +0000 (20:26 +0000)
  Fixes 'root'-style rewrite configurations

RELEASE-NOTES
includes/WebRequest.php

index 0df4c52..2f33b5a 100644 (file)
@@ -280,6 +280,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 12451) AJAX title normalization tweaks
 * When a user creating a page is not allowed to either create the page nor edit
   it, all applicable reasons are now shown.
+* (bug 11428) Allow $wgScript inside $wgArticlePath when emulating PATH_INFO
+  Fixes 'root'-style rewrite configurations
 
 
 == Parser changes in 1.12 ==
index b549b9e..aafe13f 100644 (file)
@@ -70,8 +70,19 @@ class WebRequest {
                                if( $a ) {
                                        $path = $a['path'];
                                        
+                                       global $wgScript;
+                                       if( $path == $wgScript ) {
+                                               // Script inside a rewrite path?
+                                               // Abort to keep from breaking...
+                                               return;
+                                       }
+                                       // Raw PATH_INFO style
+                                       $matches = $this->extractTitle( $path, "$wgScript/$1" );
+                                       
                                        global $wgArticlePath;
-                                       $matches = $this->extractTitle( $path, $wgArticlePath );
+                                       if( !$matches && $wgActionPaths) {
+                                               $matches = $this->extractTitle( $path, $wgArticlePath );
+                                       }
                                        
                                        global $wgActionPaths;
                                        if( !$matches && $wgActionPaths) {