* of success. If it fails, the result will specify the nature of the error.
*/
public function execute() {
- global $wgContLang;
-
$this->checkUserRightsAny( 'block' );
$user = $this->getUser();
$this->requireOnlyOneParameter( $params, 'user', 'userid' );
- # bug 15810: blocked admins should have limited access here
+ # T17810: blocked admins should have limited access here
if ( $user->isBlocked() ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
} else {
$target = User::newFromName( $params['user'] );
- // Bug 38633 - if the target is a user (not an IP address), but it
+ // T40633 - 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() ) )
$block = Block::newFromTarget( $target, null, true );
if ( $block instanceof Block ) {
- $res['expiry'] = $wgContLang->formatExpiry( $block->mExpiry, TS_ISO_8601, 'infinite' );
+ $res['expiry'] = ApiResult::formatExpiry( $block->mExpiry, 'infinite' );
$res['id'] = $block->getId();
} else {
# should be unreachable
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Block';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Block';
}
}