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
Merge "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiImageRotate.php
diff --git
a/includes/api/ApiImageRotate.php
b/includes/api/ApiImageRotate.php
index
72fb16d
..
71bda6d
100644
(file)
--- a/
includes/api/ApiImageRotate.php
+++ b/
includes/api/ApiImageRotate.php
@@
-42,6
+42,14
@@
class ApiImageRotate extends ApiBase {
'invalidTitles', 'special', 'missingIds', 'missingRevIds', 'interwikiTitles',
] );
'invalidTitles', 'special', 'missingIds', 'missingRevIds', 'interwikiTitles',
] );
+ // Check if user can add tags
+ if ( count( $params['tags'] ) ) {
+ $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $this->getUser() );
+ if ( !$ableToTag->isOK() ) {
+ $this->dieStatus( $ableToTag );
+ }
+ }
+
foreach ( $pageSet->getTitles() as $title ) {
$r = [];
$r['id'] = $title->getArticleID();
foreach ( $pageSet->getTitles() as $title ) {
$r = [];
$r['id'] = $title->getArticleID();
@@
-104,8
+112,16
@@
class ApiImageRotate extends ApiBase {
$comment = wfMessage(
'rotate-comment'
)->numParams( $rotation )->inContentLanguage()->text();
$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 {
if ( $status->isGood() ) {
$r['result'] = 'Success';
} else {
@@
-157,6
+173,10
@@
class ApiImageRotate extends ApiBase {
'continue' => [
ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
],
'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 );
];
if ( $flags ) {
$result += $this->getPageSet()->getFinalParams( $flags );