From f2c51880eae5fc0ee9eb3436517b694814a56fa8 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 2 Jan 2009 16:34:43 +0000 Subject: [PATCH] (bug 16850) Allow $wgActionPaths to contain query strings. --- RELEASE-NOTES | 2 ++ includes/Title.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 77d3a8ac00..b5ceb1d162 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Title.php b/includes/Title.php index 45625a059b..035314a60d 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ) { -- 2.20.1