(bug 16850) Allow $wgActionPaths to contain query strings.
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 2 Jan 2009 16:34:43 +0000 (16:34 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 2 Jan 2009 16:34:43 +0000 (16:34 +0000)
RELEASE-NOTES
includes/Title.php

index 77d3a8a..b5ceb1d 100644 (file)
@@ -462,6 +462,8 @@ The following extensions are migrated into MediaWiki 1.14:
   file extension (e.g. Foo. jpg).
 * Image moving over an existing file no longer throws a database error
 * (bug 16786) Restored "redundant" links recently removed from Classic sidebar
+* (bug 16850) $wgActionPaths can have query strings now, previously, this broke
+  local URLs
 
 
 === API changes in 1.14 ===
index 45625a0..035314a 100644 (file)
@@ -760,7 +760,10 @@ class Title {
                                                $query = $matches[1];
                                                if( isset( $matches[4] ) ) $query .= $matches[4];
                                                $url = str_replace( '$1', $dbkey, $wgActionPaths[$action] );
-                                               if( $query != '' ) $url .= '?' . $query;
+                                               if( $query != '' ) {
+                                                       $url .= ( strpos( $wgActionPaths[$action], '?' ) 
+                                                                               === false ? '?' : '&' ) . $query;
+                                               }
                                        }
                                }
                                if ( $url === false ) {