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 "phpunit: Remove outdated comment about calling of LinkCache::clear()"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiBlock.php
diff --git
a/includes/api/ApiBlock.php
b/includes/api/ApiBlock.php
index
8577ad2
..
366a6df
100644
(file)
--- a/
includes/api/ApiBlock.php
+++ b/
includes/api/ApiBlock.php
@@
-67,12
+67,12
@@
class ApiBlock extends ApiBase {
$params['user'] = $username;
}
} else {
$params['user'] = $username;
}
} else {
-
$target = User::newFromNam
e( $params['user'] );
+
list( $target, $type ) = SpecialBlock::getTargetAndTyp
e( $params['user'] );
// T40633 - if the target is a user (not an IP address), but it
// doesn't exist or is unusable, error.
// T40633 - if the target is a user (not an IP address), but it
// doesn't exist or is unusable, error.
- if ( $t
arget instanceof User
&&
- ( $target->isAnon() /* doesn't exist */ || !User::isUsableName( $
target->getName()
) )
+ if ( $t
ype === Block::TYPE_USER
&&
+ ( $target->isAnon() /* doesn't exist */ || !User::isUsableName( $
params['user']
) )
) {
$this->dieWithError( [ 'nosuchusershort', $params['user'] ], 'nosuchuser' );
}
) {
$this->dieWithError( [ 'nosuchusershort', $params['user'] ], 'nosuchuser' );
}
@@
-193,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';
}
}
}
}