Page MenuHomePhabricator

REL_119.patch

Authored By
bzimport
Nov 22 2014, 1:12 AM
Size
1 KB
Referenced Files
None
Subscribers
None

REL_119.patch

From bb99263aebd8437de3b3c1f10913fd4f39aca774 Mon Sep 17 00:00:00 2001
From: csteipp <csteipp@wikimedia.org>
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

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9715
Default Alt Text
REL_119.patch (1 KB)

Event Timeline