class PurgeAction extends FormAction {
+ private $redirectParams;
+
public function getName() {
return 'purge';
}
$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();
}
public function onSuccess() {
- $this->getOutput()->redirect( $this->getTitle()->getFullUrl( $this->getRequest()->getVal( 'redirectparams', '' ) ) );
+ $this->getOutput()->redirect( $this->getTitle()->getFullUrl( $this->redirectParams ) );
}
}