(bug 43518) API action=unblock should return the user name, not the full user object
authorAlex Monk <krenair@gmail.com>
Sun, 30 Dec 2012 13:59:48 +0000 (13:59 +0000)
committercsteipp <csteipp@wikimedia.org>
Mon, 4 Mar 2013 19:33:24 +0000 (11:33 -0800)
Change-Id: I830e210122a6608b4b599bb0b59c1c99b073c06d

includes/api/ApiUnblock.php

index bc7f6e7..55e7331 100644 (file)
@@ -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 );