Merge "(bug 19195) Make user IDs more readily available with the API"
[lhc/web/wiklou.git] / includes / api / ApiUnblock.php
index 32e0d88..49353b6 100644 (file)
@@ -78,7 +78,9 @@ 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;
+               $res['userid'] = $target instanceof User ? $target->getId() : 0;
                $res['reason'] = $params['reason'];
                $this->getResult()->addValue( null, $this->getModuleName(), $res );
        }