dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace MimeMagic::singleton() calls
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiPatrol.php
diff --git
a/includes/api/ApiPatrol.php
b/includes/api/ApiPatrol.php
index
6252882
..
06e8ae2
100644
(file)
--- a/
includes/api/ApiPatrol.php
+++ b/
includes/api/ApiPatrol.php
@@
-40,19
+40,16
@@
class ApiPatrol extends ApiBase {
if ( isset( $params['rcid'] ) ) {
$rc = RecentChange::newFromId( $params['rcid'] );
if ( !$rc ) {
if ( isset( $params['rcid'] ) ) {
$rc = RecentChange::newFromId( $params['rcid'] );
if ( !$rc ) {
- $this->die
UsageMsg( [ '
nosuchrcid', $params['rcid'] ] );
+ $this->die
WithError( [ 'apierror-
nosuchrcid', $params['rcid'] ] );
}
} else {
$rev = Revision::newFromId( $params['revid'] );
if ( !$rev ) {
}
} else {
$rev = Revision::newFromId( $params['revid'] );
if ( !$rev ) {
- $this->die
UsageMsg( [ '
nosuchrevid', $params['revid'] ] );
+ $this->die
WithError( [ 'apierror-
nosuchrevid', $params['revid'] ] );
}
$rc = $rev->getRecentChange();
if ( !$rc ) {
}
$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
+67,7
@@
class ApiPatrol extends ApiBase {
$retval = $rc->doMarkPatrolled( $user, false, $tags );
if ( $retval ) {
$retval = $rc->doMarkPatrolled( $user, false, $tags );
if ( $retval ) {
- $this->die
UsageMsg( reset( $retval
) );
+ $this->die
Status( $this->errorArrayToStatus( $retval, $user
) );
}
$result = [ 'rcid' => intval( $rc->getAttribute( 'rc_id' ) ) ];
}
$result = [ 'rcid' => intval( $rc->getAttribute( 'rc_id' ) ) ];
@@
-115,6
+112,6
@@
class ApiPatrol extends ApiBase {
}
public function getHelpUrls() {
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Patrol';
+ return 'https://www.mediawiki.org/wiki/
Special:MyLanguage/
API:Patrol';
}
}
}
}