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
This commit is contained in:
Matěj Suchánek 2017-09-20 16:14:02 +02:00
parent 9382c24934
commit 08899056d2

View file

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