Followup r79638
authorSam Reed <reedy@users.mediawiki.org>
Wed, 5 Jan 2011 17:57:12 +0000 (17:57 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 5 Jan 2011 17:57:12 +0000 (17:57 +0000)
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

index 9a45db1..fe54d5f 100644 (file)
@@ -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;
                                }
                        }