From: Happy-melon Date: Tue, 19 Apr 2011 16:20:19 +0000 (+0000) Subject: Follow-up r86143: retain query parameters for quick-purge as well as for the full... X-Git-Tag: 1.31.0-rc.0~30702 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=c4d32f30273ee18a38dab92940ab1e4ffa6b56e5;p=lhc%2Fweb%2Fwiklou.git Follow-up r86143: retain query parameters for quick-purge as well as for the full form. --- 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 ) ); } }