X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiUnblock.php;h=f038b9683bc448119e8d0997b0484208995c92fa;hp=887edaae8104d35043648c5e17c9eeabc90a48bc;hb=a3cd158d8433e41cbeb299f0e268dfef363b2afd;hpb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1 diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index 887edaae81..f038b9683b 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -1,9 +1,5 @@ .@gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -32,6 +28,8 @@ */ class ApiUnblock extends ApiBase { + use ApiBlockInfoTrait; + /** * Unblocks the specified user or provides the reason the unblock failed. */ @@ -45,13 +43,14 @@ class ApiUnblock extends ApiBase { $this->dieWithError( 'apierror-permissiondenied-unblock', 'permissiondenied' ); } # T17810: blocked admins should have limited access here - if ( $user->isBlocked() ) { + $block = $user->getBlock(); + if ( $block ) { $status = SpecialBlock::checkUnblockSelf( $params['user'], $user ); if ( $status !== true ) { $this->dieWithError( $status, null, - [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) ] + [ 'blockinfo' => $this->getBlockInfo( $block ) ] ); } }