aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiBlock.php
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2017-01-13 17:42:04 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2017-01-13 17:42:04 +0000
commit892b17237bb44630fa6f508c5bf85374a62def13 (patch)
tree6d3dc3307700c3040634ffec201d6a7192b9cf6c /includes/api/ApiBlock.php
parent8c437070041138b87ce14c620688851e75f686e5 (diff)
parentf3f2df07ec1da00d78cb88250abb50d28dc17459 (diff)
downloadmediawikicore-892b17237bb44630fa6f508c5bf85374a62def13.tar.gz
mediawikicore-892b17237bb44630fa6f508c5bf85374a62def13.zip
Merge "Add parameter to API modules to apply change tags to log entries"
Diffstat (limited to 'includes/api/ApiBlock.php')
-rw-r--r--includes/api/ApiBlock.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php
index c3aab8819026..58e3d1c58d2e 100644
--- a/includes/api/ApiBlock.php
+++ b/includes/api/ApiBlock.php
@@ -78,6 +78,13 @@ class ApiBlock extends ApiBase {
}
}
+ if ( $params['tags'] ) {
+ $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user );
+ if ( !$ableToTag->isOK() ) {
+ $this->dieStatus( $ableToTag );
+ }
+ }
+
if ( $params['hidename'] && !$user->isAllowed( 'hideuser' ) ) {
$this->dieWithError( 'apierror-canthide' );
}
@@ -103,6 +110,7 @@ class ApiBlock extends ApiBase {
'Reblock' => $params['reblock'],
'Watch' => $params['watchuser'],
'Confirm' => true,
+ 'Tags' => $params['tags'],
];
$retval = SpecialBlock::processForm( $data, $this->getContext() );
@@ -162,6 +170,10 @@ class ApiBlock extends ApiBase {
'allowusertalk' => false,
'reblock' => false,
'watchuser' => false,
+ 'tags' => [
+ ApiBase::PARAM_TYPE => 'tags',
+ ApiBase::PARAM_ISMULTI => true,
+ ],
];
}