X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPurge.php;h=34f9b6c84ec610fb1e08b2458c2022578cb8fc60;hb=1470d68c4cb13800bbe76c57fe1b8238ce0e2e16;hp=a22be498c5e29863f2b2e1028d9398efa3945267;hpb=2d563cf587efb97c87be23feea65537d54cfcaa9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index a22be498c5..34f9b6c84e 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -47,16 +47,22 @@ class ApiPurge extends ApiBase { $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.