'user' => null,
'newbie' => null,
),
+ 'purge' => array( // purging pages
+ 'anon' => null,
+ 'user' => null,
+ 'newbie' => null,
+ 'ip' => null,
+ 'subnet' => null,
+ ),
);
/**
// 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 )
$pageSet->execute();
$result = $pageSet->getInvalidTitlesAndRevisions();
+ $user = $this->getUser();
foreach ( $pageSet->getGoodTitles() as $title ) {
$r = array();
ApiQueryBase::addTitleInfo( $r, $title );
$page = WikiPage::factory( $title );
- $page->doPurge(); // Directly purge and skip the UI part of purge().
- $r['purged'] = true;
+ if ( !$user->pingLimiter( 'purge' ) ) {
+ $page->doPurge(); // Directly purge and skip the UI part of purge().
+ $r['purged'] = true;
+ } else {
+ $error = $this->parseMsg( array( 'actionthrottledtext' ) );
+ $this->setWarning( $error['info'] );
+ }
if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
- if ( !$this->getUser()->pingLimiter( 'linkpurge' ) ) {
+ if ( !$user->pingLimiter( 'linkpurge' ) ) {
$popts = $page->makeParserOptions( 'canonical' );
# Parse content; note that HTML generation is only needed if we want to cache the result.
"viewsource": "View source",
"viewsource-title": "View source for $1",
"actionthrottled": "Action throttled",
- "actionthrottledtext": "As an anti-spam measure, you are limited from performing this action too many times in a short space of time, and you have exceeded this limit.\nPlease try again in a few minutes.",
+ "actionthrottledtext": "As an anti-abuse measure, you are limited from performing this action too many times in a short space of time, and you have exceeded this limit.\nPlease try again in a few minutes.",
"protectedpagetext": "This page has been protected to prevent editing or other actions.",
"viewsourcetext": "You can view and copy the source of this page.",
"viewyourtext": "You can view and copy the source of <strong>your edits</strong> to this page.",