From ff975f393205cdd50c87ba23c4eb1a9fe1b915a5 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 15 Apr 2010 11:54:16 +0000 Subject: [PATCH] Special:Random now carries over query string parameters --- RELEASE-NOTES | 1 + includes/specials/SpecialRandompage.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ed91637c4c..d75078fed3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -46,6 +46,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 22474) {{urlencode:}} now takes an optional second paramter for type of escaping. * Special:Listfiles now supports a username parameter +* Special:Random carries over query string parameters === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/includes/specials/SpecialRandompage.php b/includes/specials/SpecialRandompage.php index fd3f17f2ff..ed6651fd53 100644 --- a/includes/specials/SpecialRandompage.php +++ b/includes/specials/SpecialRandompage.php @@ -33,7 +33,7 @@ class RandomPage extends SpecialPage { } public function execute( $par ) { - global $wgOut, $wgContLang; + global $wgOut, $wgContLang, $wgRequest; if ($par) { $this->setNamespace( $wgContLang->getNsIndex( $par ) ); @@ -48,7 +48,9 @@ class RandomPage extends SpecialPage { return; } - $query = $this->isRedirect() ? 'redirect=no' : ''; + $redirectParam = $this->isRedirect() ? array( 'redirect' => 'no' ) : array(); + $query = array_merge( $wgRequest->getValues(), $redirectParam ); + unset( $query['title'] ); $wgOut->redirect( $title->getFullUrl( $query ) ); } -- 2.20.1