r86412 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86411‎ | r86412 | r86413 >
Date:16:20, 19 April 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Follow-up r86143: retain query parameters for quick-purge as well as for the full form.
Modified paths:
  • /trunk/phase3/includes/actions/PurgeAction.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/actions/PurgeAction.php
@@ -25,6 +25,8 @@
2626
2727 class PurgeAction extends FormAction {
2828
 29+ private $redirectParams;
 30+
2931 public function getName() {
3032 return 'purge';
3133 }
@@ -65,9 +67,14 @@
6668 $this->checkCanExecute( $this->getUser() );
6769
6870 if ( $this->getUser()->isAllowed( 'purge' ) ) {
 71+ $this->redirectParams = wfArrayToCGI( array_diff_key(
 72+ $this->getRequest()->getQueryValues(),
 73+ array( 'title' => null, 'action' => null )
 74+ ) );
6975 $this->onSubmit( array() );
7076 $this->onSuccess();
7177 } else {
 78+ $this->redirectParams = $this->getRequest()->getVal( 'redirectparams', '' );
7279 $form = $this->getForm();
7380 if ( $form->show() ) {
7481 $this->onSuccess();
@@ -88,6 +95,6 @@
8996 }
9097
9198 public function onSuccess() {
92 - $this->getOutput()->redirect( $this->getTitle()->getFullUrl( $this->getRequest()->getVal( 'redirectparams', '' ) ) );
 99+ $this->getOutput()->redirect( $this->getTitle()->getFullUrl( $this->redirectParams ) );
93100 }
94101 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86143Follow-up r86041: fix redirect in PurgeAction, and pass query parameters thro...happy-melon22:11, 15 April 2011

Status & tagging log