saper has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/92257


Change subject: Display parent block target in autoblock errors
......................................................................

Display parent block target in autoblock errors

If the reason to block is autoblock, display original block
target username and not an IP address of the current user.

Bug: 56227
Change-Id: I7fad56d6537dcec3cb36aeba40e01daf215515bd
---
M includes/Block.php
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/92257/1

diff --git a/includes/Block.php b/includes/Block.php
index 34b89e7..f008939 100644
--- a/includes/Block.php
+++ b/includes/Block.php
@@ -1417,7 +1417,12 @@
 
                /* $ip returns who *is* being blocked, $intended contains who 
was meant to be blocked.
                 * This could be a username, an IP range, or a single IP. */
-               $intended = $this->getTarget();
+               if ( $this->mAuto ) {
+                       $parent = $this->mParentBlockId;
+                       $intended = self::newFromId( $parent 
)->getRedactedName();
+               } else {
+                       $intended = $this->getRedactedName();
+               }
 
                $lang = $context->getLanguage();
                return array(

-- 
To view, visit https://gerrit.wikimedia.org/r/92257
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7fad56d6537dcec3cb36aeba40e01daf215515bd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: saper <sa...@saper.info>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to