X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPurge.php;h=83227a2fc2d83c5b0f8748834b7db3c32ea48bbc;hb=b1795df3ccd3daea9b588249a0b4a373c89ec618;hp=f671103fb5aab9a80f6a94d76fce634762f89012;hpb=dc0cdc8a4dd0265317ce9a93a0579a9f84419c87;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index f671103fb5..83227a2fc2 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -55,11 +55,11 @@ class ApiPurge extends ApiBase { 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 ) { @@ -103,8 +103,7 @@ class ApiPurge extends ApiBase { } } } else { - $error = $this->parseMsg( [ 'actionthrottledtext' ] ); - $this->setWarning( $error['info'] ); + $this->addWarning( 'apierror-ratelimited' ); $forceLinkUpdate = false; } } @@ -149,8 +148,7 @@ class ApiPurge extends ApiBase { } public function mustBePosted() { - // Anonymous users are not allowed a non-POST request - return !$this->getUser()->isAllowed( 'purge' ); + return true; } public function getAllowedParams( $flags = 0 ) { @@ -178,6 +176,6 @@ class ApiPurge extends ApiBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Purge'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Purge'; } }