From db2f895531d61866a235208028601c6a95cf256e Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Sat, 24 Aug 2013 18:30:29 +0200 Subject: [PATCH] Fix form submission on Special:RandomInCategory You can't have parameters in the action for GET forms, browsers are going to trim them off. This is the way passing title in handled on other special pages, e.g. Special:Contributions. Change-Id: I00728a085641b8a6cda50a55ad1e9b1de68b97bc --- includes/specials/SpecialRandomInCategory.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialRandomInCategory.php b/includes/specials/SpecialRandomInCategory.php index fd554e6462..d7f56ed487 100644 --- a/includes/specials/SpecialRandomInCategory.php +++ b/includes/specials/SpecialRandomInCategory.php @@ -68,6 +68,8 @@ class SpecialRandomInCategory extends SpecialPage { } public function execute( $par ) { + global $wgScript; + $cat = false; $categoryStr = $this->getRequest()->getText( 'category', $par ); @@ -99,7 +101,8 @@ class SpecialRandomInCategory extends SpecialPage { $submit = Html::input( '', $submitText, 'submit' ); $msg = $this->msg( 'randomincategory-selectcategory' ); - $form = Html::rawElement( 'form', array( 'action' => $this->getTitle()->getLocalUrl() ), + $form = Html::rawElement( 'form', array( 'action' => $wgScript ), + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . $msg->rawParams( $input, $submit )->parse() ); $this->getOutput()->addHtml( $form ); -- 2.20.1