X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiPatrol.php;h=a20aca4db35fdc1ef607cbcaf086c81ab91a746f;hp=62528825ded0e9e8911d8128807194cacf52a094;hb=a2c8c2969420a0f150c03f76e3a0bf9028fcda43;hpb=57eaa2bf04ce1b48bd89c10defe4de5b7d31f047 diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 62528825de..a20aca4db3 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -2,8 +2,6 @@ /** * API for MediaWiki 1.14+ * - * Created on Sep 2, 2008 - * * Copyright © 2008 Soxred93 soxred93@gmail.com, * * This program is free software; you can redistribute it and/or modify @@ -40,19 +38,16 @@ class ApiPatrol extends ApiBase { if ( isset( $params['rcid'] ) ) { $rc = RecentChange::newFromId( $params['rcid'] ); if ( !$rc ) { - $this->dieUsageMsg( [ 'nosuchrcid', $params['rcid'] ] ); + $this->dieWithError( [ 'apierror-nosuchrcid', $params['rcid'] ] ); } } else { $rev = Revision::newFromId( $params['revid'] ); if ( !$rev ) { - $this->dieUsageMsg( [ 'nosuchrevid', $params['revid'] ] ); + $this->dieWithError( [ 'apierror-nosuchrevid', $params['revid'] ] ); } $rc = $rev->getRecentChange(); if ( !$rc ) { - $this->dieUsage( - 'The revision ' . $params['revid'] . " can't be patrolled as it's too old", - 'notpatrollable' - ); + $this->dieWithError( [ 'apierror-notpatrollable', $params['revid'] ] ); } } @@ -70,7 +65,7 @@ class ApiPatrol extends ApiBase { $retval = $rc->doMarkPatrolled( $user, false, $tags ); if ( $retval ) { - $this->dieUsageMsg( reset( $retval ) ); + $this->dieStatus( $this->errorArrayToStatus( $retval, $user ) ); } $result = [ 'rcid' => intval( $rc->getAttribute( 'rc_id' ) ) ]; @@ -115,6 +110,6 @@ class ApiPatrol extends ApiBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Patrol'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Patrol'; } }