From 08899056d2f046a3df5abe47563acea853bf7353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Wed, 20 Sep 2017 16:14:02 +0200 Subject: [PATCH] Normalize IPv6 addresses in Special:AbuseFilter/test Forcing user namespace will handle IPv6 correctly as well as possible "User:" prefix supported by the former code. Bug: T176045 Change-Id: I0b4a5468ca44799cade0b0774d749e05d4ff5865 --- includes/Views/AbuseFilterViewTestBatch.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/includes/Views/AbuseFilterViewTestBatch.php b/includes/Views/AbuseFilterViewTestBatch.php index abc33fc60..e039c6192 100644 --- a/includes/Views/AbuseFilterViewTestBatch.php +++ b/includes/Views/AbuseFilterViewTestBatch.php @@ -176,15 +176,7 @@ class AbuseFilterViewTestBatch extends AbuseFilterView { } // Normalise username - $userTitle = Title::newFromText( $testUsername ); - - if ( $userTitle && $userTitle->getNamespace() == NS_USER ) { - $this->mTestUser = $userTitle->getText(); // Allow User:Blah syntax. - } elseif ( $userTitle ) { - // Not sure of the value of prefixedText over text, but no need to munge unnecessarily. - $this->mTestUser = $userTitle->getPrefixedText(); - } else { - $this->mTestUser = null; // No user specified. - } + $userTitle = Title::newFromText( $testUsername, NS_USER ); + $this->mTestUser = $userTitle ? $userTitle->getText() : null; } }