Merge "HTML escape parameter 'text' of hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / includes / api / ApiUnblock.php
index b748cb3..f038b96 100644 (file)
@@ -28,6 +28,8 @@
  */
 class ApiUnblock extends ApiBase {
 
+       use ApiBlockInfoTrait;
+
        /**
         * Unblocks the specified user or provides the reason the unblock failed.
         */
@@ -41,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 ) ]
                                );
                        }
                }