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
This commit is contained in:
vladshapik 2021-02-24 15:31:50 +02:00
parent fca6b71a44
commit 107c0dfccd

View file

@ -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