X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPatrol.php;h=62528825ded0e9e8911d8128807194cacf52a094;hb=81daa69f8b8493469570c9e6cb7cc8cae43697c1;hp=1230babb9b80997324ad2f11f6c15c891b2aa385;hpb=734ca2b4d2a1246fb0ea1e54b861ab423ab5e257;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 1230babb9b..62528825de 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -56,7 +56,18 @@ class ApiPatrol extends ApiBase { } } - $retval = $rc->doMarkPatrolled( $this->getUser() ); + $user = $this->getUser(); + $tags = $params['tags']; + + // Check if user can add tags + if ( !is_null( $tags ) ) { + $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $tags, $user ); + if ( !$ableToTag->isOK() ) { + $this->dieStatus( $ableToTag ); + } + } + + $retval = $rc->doMarkPatrolled( $user, false, $tags ); if ( $retval ) { $this->dieUsageMsg( reset( $retval ) ); @@ -83,6 +94,10 @@ class ApiPatrol extends ApiBase { 'revid' => [ ApiBase::PARAM_TYPE => 'integer' ], + 'tags' => [ + ApiBase::PARAM_TYPE => 'tags', + ApiBase::PARAM_ISMULTI => true, + ], ]; }