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 "Stop using SiteConfiguration::isLocalVHost()"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiUpload.php
diff --git
a/includes/api/ApiUpload.php
b/includes/api/ApiUpload.php
index
82f66a8
..
d674846
100644
(file)
--- a/
includes/api/ApiUpload.php
+++ b/
includes/api/ApiUpload.php
@@
-703,6
+703,13
@@
class ApiUpload extends ApiBase {
$watch = true;
}
$watch = true;
}
+ if ( $this->mParams['tags'] ) {
+ $status = ChangeTags::canAddTagsAccompanyingChange( $this->mParams['tags'], $this->getUser() );
+ if ( !$status->isOK() ) {
+ $this->dieStatus( $status );
+ }
+ }
+
// No errors, no warnings: do the upload
if ( $this->mParams['async'] ) {
$progress = UploadBase::getSessionStatus( $this->getUser(), $this->mParams['filekey'] );
// No errors, no warnings: do the upload
if ( $this->mParams['async'] ) {
$progress = UploadBase::getSessionStatus( $this->getUser(), $this->mParams['filekey'] );
@@
-720,6
+727,7
@@
class ApiUpload extends ApiBase {
'filename' => $this->mParams['filename'],
'filekey' => $this->mParams['filekey'],
'comment' => $this->mParams['comment'],
'filename' => $this->mParams['filename'],
'filekey' => $this->mParams['filekey'],
'comment' => $this->mParams['comment'],
+ 'tags' => $this->mParams['tags'],
'text' => $this->mParams['text'],
'watch' => $watch,
'session' => $this->getContext()->exportSession()
'text' => $this->mParams['text'],
'watch' => $watch,
'session' => $this->getContext()->exportSession()
@@
-730,7
+738,7
@@
class ApiUpload extends ApiBase {
} else {
/** @var $status Status */
$status = $this->mUpload->performUpload( $this->mParams['comment'],
} else {
/** @var $status Status */
$status = $this->mUpload->performUpload( $this->mParams['comment'],
- $this->mParams['text'], $watch, $this->getUser() );
+ $this->mParams['text'], $watch, $this->getUser()
, $this->mParams['tags']
);
if ( !$status->isGood() ) {
$error = $status->getErrorsArray();
if ( !$status->isGood() ) {
$error = $status->getErrorsArray();
@@
-764,6
+772,10
@@
class ApiUpload extends ApiBase {
'comment' => array(
ApiBase::PARAM_DFLT => ''
),
'comment' => array(
ApiBase::PARAM_DFLT => ''
),
+ 'tags' => array(
+ ApiBase::PARAM_TYPE => 'tags',
+ ApiBase::PARAM_ISMULTI => true,
+ ),
'text' => array(
ApiBase::PARAM_TYPE => 'text',
),
'text' => array(
ApiBase::PARAM_TYPE => 'text',
),