From: Alex Monk Date: Sun, 30 Dec 2012 13:59:48 +0000 (+0000) Subject: (bug 43518) API action=unblock should return the user name, not the full user object X-Git-Tag: 1.31.0-rc.0~20491 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22lang_raccourcis%22%2C%22module=%24nom_module%22%29%20.%20%22?a=commitdiff_plain;h=49f730521b6e2f6595012a25e6d61685ad5d6adc;p=lhc%2Fweb%2Fwiklou.git (bug 43518) API action=unblock should return the user name, not the full user object Change-Id: I830e210122a6608b4b599bb0b59c1c99b073c06d --- diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index bc7f6e7287..55e7331df9 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -75,7 +75,7 @@ class ApiUnblock extends ApiBase { $res['id'] = $block->getId(); $target = $block->getType() == Block::TYPE_AUTO ? '' : $block->getTarget(); - $res['user'] = $target; + $res['user'] = $target instanceof User ? $target->getName() : $target; $res['userid'] = $target instanceof User ? $target->getId() : 0; $res['reason'] = $params['reason']; $this->getResult()->addValue( null, $this->getModuleName(), $res );