From bb99263aebd8437de3b3c1f10913fd4f39aca774 Mon Sep 17 00:00:00 2001 From: csteipp Date: Fri, 15 Feb 2013 17:02:27 -0800 Subject: [PATCH] (bug 43518) API action=unblock should return the user name, not the full user object Change-Id: I2209faccfedf244af7056a81c0b5f0d7d5cc6706 --- includes/api/ApiUnblock.php | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index db94fd5..d0ad3a8 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -78,7 +78,8 @@ class ApiUnblock extends ApiBase { } $res['id'] = $block->getId(); - $res['user'] = $block->getType() == Block::TYPE_AUTO ? '' : $block->getTarget(); + $target = $block->getType() == Block::TYPE_AUTO ? '' : $block->getTarget(); + $res['user'] = $target instanceof User ? $target->getName() : $target; $res['reason'] = $params['reason']; $this->getResult()->addValue( null, $this->getModuleName(), $res ); } -- 1.7.5.4