// This will throw exceptions if there's a problem
$this->checkCanExecute( $this->getUser() );
- if ( $this->getUser()->isAllowed( 'purge' ) ) {
+ $user = $this->getUser();
+
+ if ( $user->pingLimiter( 'purge' ) ) {
+ // TODO: Display actionthrottledtext
+ return;
+ }
+
+ if ( $user->isAllowed( 'purge' ) ) {
$this->redirectParams = wfArrayToCgi( array_diff_key(
$this->getRequest()->getQueryValues(),
- array( 'title' => null, 'action' => null )
+ [ 'title' => null, 'action' => null ]
) );
- if ( $this->onSubmit( array() ) ) {
+ if ( $this->onSubmit( [] ) ) {
$this->onSuccess();
}
} else {
public function onSuccess() {
$this->getOutput()->redirect( $this->getTitle()->getFullURL( $this->redirectParams ) );
}
+
+ public function doesWrites() {
+ return true;
+ }
}