From: Glaisher Date: Fri, 29 Apr 2016 17:38:35 +0000 (+0500) Subject: Make sure OtherBlockLogLink's second parameter is a string X-Git-Tag: 1.31.0-rc.0~7103^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=a69c730dbb3ef1f1243053f825b7fef92ba421e2;p=lhc%2Fweb%2Fwiklou.git Make sure OtherBlockLogLink's second parameter is a string Bug: T132935 Change-Id: I0583d166d8bfc50e6d10a0ac46c18aeadefad068 --- diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 625e4aa946..fcadedebc1 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -28,7 +28,7 @@ * @ingroup SpecialPage */ class SpecialBlock extends FormSpecialPage { - /** @var User User to be blocked, as passed either by parameter (url?wpTarget=Foo) + /** @var User|string|null User to be blocked, as passed either by parameter (url?wpTarget=Foo) * or as subpage (Special:Block/Foo) */ protected $target; @@ -330,8 +330,12 @@ class SpecialBlock extends FormSpecialPage { $otherBlockMessages = []; if ( $this->target !== null ) { + $targetName = $this->target; + if ( $this->target instanceof User ) { + $targetName = $this->target->getName(); + } # Get other blocks, i.e. from GlobalBlocking or TorBlock extension - Hooks::run( 'OtherBlockLogLink', [ &$otherBlockMessages, $this->target ] ); + Hooks::run( 'OtherBlockLogLink', [ &$otherBlockMessages, $targetName ] ); if ( count( $otherBlockMessages ) ) { $s = Html::rawElement(