jenkins-bot has submitted this change and it was merged.
Change subject: (bug 43518) API action=unblock should return the user name, not
the full user object
......................................................................
(bug 43518) API action=unblock should return the user name, not the full user
object
Change-Id: I2209faccfedf244af7056a81c0b5f0d7d5cc6706
---
M includes/api/ApiUnblock.php
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Alex Monk: Looks good to me, approved
jenkins-bot: Verified
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 @@
}
$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 );
}
--
To view, visit https://gerrit.wikimedia.org/r/52081
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2209faccfedf244af7056a81c0b5f0d7d5cc6706
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_19
Gerrit-Owner: CSteipp <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits