Normalize IPv6 addresses in Special:AbuseFilter/examine

This is re-application of I0b4a5468c.

Change-Id: Ifad191f460717e70203f1740103f3af77b21b03d
This commit is contained in:
Matěj Suchánek 2017-11-17 16:24:42 +01:00
parent 6945284054
commit a7ac1f2b3f

View file

@ -199,23 +199,15 @@ class AbuseFilterViewExamine extends AbuseFilterView {
function loadParameters() {
$request = $this->getRequest();
$searchUsername = $request->getText( 'wpSearchUser' );
$this->mSearchPeriodStart = $request->getText( 'wpSearchPeriodStart' );
$this->mSearchPeriodEnd = $request->getText( 'wpSearchPeriodEnd' );
$this->mSubmit = $request->getCheck( 'submit' );
$this->mTestFilter = $request->getText( 'testfilter' );
// Normalise username
$userTitle = Title::newFromText( $searchUsername );
if ( $userTitle && $userTitle->getNamespace() == NS_USER ) {
$this->mSearchUser = $userTitle->getText(); // Allow User:Blah syntax.
} elseif ( $userTitle ) {
// Not sure of the value of prefixedText over text, but no need to munge unnecessarily.
$this->mSearchUser = $userTitle->getPrefixedText();
} else {
$this->mSearchUser = '';
}
$searchUsername = $request->getText( 'wpSearchUser' );
$userTitle = Title::newFromText( $searchUsername, NS_USER );
$this->mSearchUser = $userTitle ? $userTitle->getText() : '';
}
}