Add userlink to IP ranges on Special:BlockList

This was previously removed because Special:Contributions could not show
contributions from IP ranges. It now does.

Bug: T233082
Change-Id: I2ec45807ca515a83309e8dbecce53840951e2d5f
This commit is contained in:
Ammar 2019-10-06 11:12:05 +01:00
parent 35cbf23c4f
commit 84380c8c9c

View file

@ -115,20 +115,18 @@ class BlockListPager extends TablePager {
$formatted = $this->msg( 'autoblockid', $row->ipb_id )->parse();
} else {
list( $target, $type ) = DatabaseBlock::parseTarget( $row->ipb_address );
switch ( $type ) {
case DatabaseBlock::TYPE_USER:
case DatabaseBlock::TYPE_IP:
$formatted = Linker::userLink( $target->getId(), $target );
$formatted .= Linker::userToolLinks(
$target->getId(),
$target,
false,
Linker::TOOL_LINKS_NOBLOCK
);
break;
case DatabaseBlock::TYPE_RANGE:
$formatted = htmlspecialchars( $target );
if ( $type === DatabaseBlock::TYPE_RANGE ) {
$user = User::newFromName( $target, false );
} else {
$user = $target;
}
$formatted = Linker::userLink( $user->getId(), $user );
$formatted .= Linker::userToolLinks(
$user->getId(),
$user,
false,
Linker::TOOL_LINKS_NOBLOCK
);
}
break;