Bug: T132935
Change-Id: I0583d166d8bfc50e6d10a0ac46c18aeadefad068
* @ingroup SpecialPage
*/
class SpecialBlock extends FormSpecialPage {
* @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;
* or as subpage (Special:Block/Foo) */
protected $target;
$otherBlockMessages = [];
if ( $this->target !== null ) {
$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
# 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(
if ( count( $otherBlockMessages ) ) {
$s = Html::rawElement(