From bfce19b61bc461c83ff8145e6cead4f2f9fac7ea Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 5 Jan 2011 17:57:12 +0000 Subject: [PATCH] Followup r79638 If we're ping limited, add a warning as such, and don't bother trying to linkupdate any of the other articles in the output. --- includes/api/ApiPurge.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 9a45db124e..fe54d5f41a 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -49,6 +49,9 @@ class ApiPurge extends ApiBase { !$this->getMain()->getRequest()->wasPosted() ) { $this->dieUsageMsg( array( 'mustbeposted', $this->getModuleName() ) ); } + + $forceLinkUpdate = $params['forcelinkupdate']; + $result = array(); foreach ( $params['titles'] as $t ) { $r = array(); @@ -69,7 +72,7 @@ class ApiPurge extends ApiBase { $article->doPurge(); // Directly purge and skip the UI part of purge(). $r['purged'] = ''; - if( $params['forcelinkupdate'] ) { + if( $forceLinkUpdate ) { if ( !$wgUser->pingLimiter() ) { global $wgParser, $wgEnableParserCache; $popts = new ParserOptions(); @@ -85,6 +88,9 @@ class ApiPurge extends ApiBase { $pcache = ParserCache::singleton(); $pcache->save( $p_result, $article, $popts ); } + } else { + $this->setWarning( $this->parseMsg( array( 'actionthrottledtext' ) ) ); + $forceLinkUpdate = false; } } -- 2.20.1