X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiUnblock.php;h=ace41a4e364c16f5714390d604d9f2761b12da49;hb=d6dcf23a8f22245e311d5582e4f9cd0f302e3738;hp=5f268c5b47c82de9f7f51511156c798f71f72a44;hpb=a85d1b9d0cd7f02111d3a647d5b91e3b1f334563;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index 5f268c5b47..ace41a4e36 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -63,9 +63,18 @@ class ApiUnblock extends ApiBase { } } + // Check if user can add tags + if ( !is_null( $params['tags'] ) ) { + $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user ); + if ( !$ableToTag->isOK() ) { + $this->dieStatus( $ableToTag ); + } + } + $data = [ 'Target' => is_null( $params['id'] ) ? $params['user'] : "#{$params['id']}", - 'Reason' => $params['reason'] + 'Reason' => $params['reason'], + 'Tags' => $params['tags'] ]; $block = Block::newFromTarget( $data['Target'] ); $retval = SpecialUnblock::processUnblock( $data, $this->getContext() ); @@ -96,6 +105,10 @@ class ApiUnblock extends ApiBase { ], 'user' => null, 'reason' => '', + 'tags' => [ + ApiBase::PARAM_TYPE => 'tags', + ApiBase::PARAM_ISMULTI => true, + ], ]; }