From c4d32f30273ee18a38dab92940ab1e4ffa6b56e5 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Tue, 19 Apr 2011 16:20:19 +0000 Subject: [PATCH] Follow-up r86143: retain query parameters for quick-purge as well as for the full form. --- includes/actions/PurgeAction.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/actions/PurgeAction.php b/includes/actions/PurgeAction.php index 3f54b81b6b..74f6e7d9c5 100644 --- a/includes/actions/PurgeAction.php +++ b/includes/actions/PurgeAction.php @@ -25,6 +25,8 @@ class PurgeAction extends FormAction { + private $redirectParams; + public function getName() { return 'purge'; } @@ -65,9 +67,14 @@ class PurgeAction extends FormAction { $this->checkCanExecute( $this->getUser() ); if ( $this->getUser()->isAllowed( 'purge' ) ) { + $this->redirectParams = wfArrayToCGI( array_diff_key( + $this->getRequest()->getQueryValues(), + array( 'title' => null, 'action' => null ) + ) ); $this->onSubmit( array() ); $this->onSuccess(); } else { + $this->redirectParams = $this->getRequest()->getVal( 'redirectparams', '' ); $form = $this->getForm(); if ( $form->show() ) { $this->onSuccess(); @@ -88,6 +95,6 @@ class PurgeAction extends FormAction { } public function onSuccess() { - $this->getOutput()->redirect( $this->getTitle()->getFullUrl( $this->getRequest()->getVal( 'redirectparams', '' ) ) ); + $this->getOutput()->redirect( $this->getTitle()->getFullUrl( $this->redirectParams ) ); } } -- 2.20.1