From 107c0dfccd42bf8c307cbd647f8bd1f8053ff1bd Mon Sep 17 00:00:00 2001 From: vladshapik Date: Wed, 24 Feb 2021 15:31:50 +0200 Subject: [PATCH] Avoid using User::IsIP Remove using of User::isIP since this method will be hard-deprecated. Now it is soft-deprecated Bug: T275602 Change-Id: Ic1749cbad92bfe0eeae40736403fd5ceb6d504e8 --- includes/DiscussionParser.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index fee86a774..7c0ca35be 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -352,8 +352,9 @@ abstract class EchoDiscussionParser { continue; } + $userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils(); // 2. user is an anonymous IP - if ( User::isIP( $dbk ) ) { + if ( $userNameUtils->isIP( $dbk ) ) { $userMentions['anonymousUsers'][] = $dbk; $count++; $stats->increment( 'echo.event.mention.error.anonUser' ); @@ -1122,8 +1123,9 @@ abstract class EchoDiscussionParser { $user = $userMatches[0]; + $userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils(); if ( - !User::isIP( $user ) && + !$userNameUtils->isIP( $user ) && User::getCanonicalName( $user ) === false ) { // Not a real username