ApiQueryBase::addTitleInfo( $r, $title );
$page = WikiPage::factory( $title );
if ( !$user->pingLimiter( 'purge' ) ) {
- $page->doPurge(); // Directly purge and skip the UI part of purge().
+ // Directly purge and skip the UI part of purge()
+ $page->doPurge();
$r['purged'] = true;
} else {
- $error = $this->parseMsg( [ 'actionthrottledtext' ] );
- $this->setWarning( $error['info'] );
+ $this->addWarning( 'apierror-ratelimited' );
}
if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
}
}
} else {
- $error = $this->parseMsg( [ 'actionthrottledtext' ] );
- $this->setWarning( $error['info'] );
+ $this->addWarning( 'apierror-ratelimited' );
$forceLinkUpdate = false;
}
}
}
public function mustBePosted() {
- // Anonymous users are not allowed a non-POST request
- return !$this->getUser()->isAllowed( 'purge' );
+ return true;
}
public function getAllowedParams( $flags = 0 ) {
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Purge';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Purge';
}
}