Replace deprecated IP class with IPUtils

Raise required MW version to >= 1.35.0

Bug: T242556
Change-Id: I1a61cf5e1a66fcde3edd5b010eb8c34de4b47dc3
This commit is contained in:
Ammarpad 2020-02-16 07:16:38 +00:00 committed by Umherirrender
parent 1c7e5930a2
commit 2ae6a87f6a
2 changed files with 4 additions and 2 deletions

View file

@ -9,7 +9,7 @@
"descriptionmsg": "nuke-desc",
"license-name": "GPL-2.0-or-later",
"requires": {
"MediaWiki": ">= 1.28.1"
"MediaWiki": ">= 1.35.0"
},
"type": "specialpage",
"ExtensionMessagesFiles": {

View file

@ -1,5 +1,7 @@
<?php
use Wikimedia\IPUtils;
class NukeHooks {
/**
@ -14,7 +16,7 @@ class NukeHooks {
SpecialPage $sp
) {
$username = $userPageTitle->getText();
if ( $sp->getUser()->isAllowed( 'nuke' ) && !IP::isValidRange( $username ) ) {
if ( $sp->getUser()->isAllowed( 'nuke' ) && !IPUtils::isValidRange( $username ) ) {
$toolLinks['nuke'] = $sp->getLinkRenderer()->makeKnownLink(
SpecialPage::getTitleFor( 'Nuke' ),
$sp->msg( 'nuke-linkoncontribs' )->text(),