Don't show link to Nuke for IP ranges

Bug: T175915
Change-Id: Idc73e18e3665380147f85ad27b484fade5e877a2
This commit is contained in:
Matěj Suchánek 2018-02-05 10:22:32 +01:00
parent 2b4e631b8b
commit 4f9f576d98

View file

@ -13,13 +13,13 @@ class NukeHooks {
public static function nukeContributionsLinks( $userId, $userPageTitle, &$toolLinks,
SpecialPage $sp
) {
if ( $sp->getUser()->isAllowed( 'nuke' ) ) {
$username = $userPageTitle->getText();
if ( $sp->getUser()->isAllowed( 'nuke' ) && !IP::isValidRange( $username ) ) {
$toolLinks['nuke'] = $sp->getLinkRenderer()->makeKnownLink(
SpecialPage::getTitleFor( 'Nuke' ),
$sp->msg( 'nuke-linkoncontribs' )->text(),
[ 'title' => $sp->msg( 'nuke-linkoncontribs-text',
$userPageTitle->getText() )->text() ],
[ 'target' => $userPageTitle->getText() ]
[ 'title' => $sp->msg( 'nuke-linkoncontribs-text', $username )->text() ],
[ 'target' => $username ]
);
}
}