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 "Hide <style> tags from Tidy"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiBlock.php
diff --git
a/includes/api/ApiBlock.php
b/includes/api/ApiBlock.php
index
c3aab88
..
4d37af3
100644
(file)
--- a/
includes/api/ApiBlock.php
+++ b/
includes/api/ApiBlock.php
@@
-46,7
+46,7
@@
class ApiBlock extends ApiBase {
$this->requireOnlyOneParameter( $params, 'user', 'userid' );
$this->requireOnlyOneParameter( $params, 'user', 'userid' );
- #
bug 15
810: blocked admins should have limited access here
+ #
T17
810: blocked admins should have limited access here
if ( $user->isBlocked() ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
if ( $user->isBlocked() ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
@@
-69,7
+69,7
@@
class ApiBlock extends ApiBase {
} else {
$target = User::newFromName( $params['user'] );
} else {
$target = User::newFromName( $params['user'] );
- //
Bug 38
633 - if the target is a user (not an IP address), but it
+ //
T40
633 - if the target is a user (not an IP address), but it
// doesn't exist or is unusable, error.
if ( $target instanceof User &&
( $target->isAnon() /* doesn't exist */ || !User::isUsableName( $target->getName() ) )
// doesn't exist or is unusable, error.
if ( $target instanceof User &&
( $target->isAnon() /* doesn't exist */ || !User::isUsableName( $target->getName() ) )
@@
-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' );
}
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,
'Reblock' => $params['reblock'],
'Watch' => $params['watchuser'],
'Confirm' => true,
+ 'Tags' => $params['tags'],
];
$retval = SpecialBlock::processForm( $data, $this->getContext() );
];
$retval = SpecialBlock::processForm( $data, $this->getContext() );
@@
-162,6
+170,10
@@
class ApiBlock extends ApiBase {
'allowusertalk' => false,
'reblock' => false,
'watchuser' => false,
'allowusertalk' => false,
'reblock' => false,
'watchuser' => false,
+ 'tags' => [
+ ApiBase::PARAM_TYPE => 'tags',
+ ApiBase::PARAM_ISMULTI => true,
+ ],
];
}
];
}
@@
-181,6
+193,6
@@
class ApiBlock extends ApiBase {
}
public function getHelpUrls() {
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Block';
+ return 'https://www.mediawiki.org/wiki/
Special:MyLanguage/
API:Block';
}
}
}
}