X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiImageRotate.php;h=21e2694905807dd1c767e5f1cd111fea3bd9740d;hb=11ee7f78da9776db26098642a151a288f98bea14;hp=72fb16d19ba404560ca4d8397fbdc4bd2ead5020;hpb=24dc5218b18bfa065a101057523f39a9c046d046;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php index 72fb16d19b..21e2694905 100644 --- a/includes/api/ApiImageRotate.php +++ b/includes/api/ApiImageRotate.php @@ -1,8 +1,5 @@ getUser() ); + if ( !$ableToTag->isOK() ) { + $this->dieStatus( $ableToTag ); + } + } + foreach ( $pageSet->getTitles() as $title ) { $r = []; $r['id'] = $title->getArticleID(); @@ -104,8 +109,16 @@ class ApiImageRotate extends ApiBase { $comment = wfMessage( 'rotate-comment' )->numParams( $rotation )->inContentLanguage()->text(); - $status = $file->upload( $dstPath, - $comment, $comment, 0, false, false, $this->getUser() ); + $status = $file->upload( + $dstPath, + $comment, + $comment, + 0, + false, + false, + $this->getUser(), + $params['tags'] ?: [] + ); if ( $status->isGood() ) { $r['result'] = 'Success'; } else { @@ -157,6 +170,10 @@ class ApiImageRotate extends ApiBase { 'continue' => [ ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', ], + 'tags' => [ + ApiBase::PARAM_TYPE => 'tags', + ApiBase::PARAM_ISMULTI => true, + ], ]; if ( $flags ) { $result += $this->getPageSet()->getFinalParams( $flags );