mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 02:38:16 +00:00
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:
parent
9382c24934
commit
08899056d2
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue