mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 23:40:19 +00:00
Make AbuseLog searchable by IPv6 IPs
Bug: 39449 Change-Id: Ie331ec7ef3b461ae10f0e28fe50cb86684c6d3a0
This commit is contained in:
parent
d5f282a2dd
commit
233a850a08
|
@ -70,14 +70,17 @@ class SpecialAbuseLog extends SpecialPage {
|
|||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->mSearchUser = $request->getText( 'wpSearchUser' );
|
||||
$this->mSearchUser = trim( $request->getText( 'wpSearchUser' ) );
|
||||
if ( $wgAbuseFilterIsCentral ) {
|
||||
$this->mSearchWiki = $request->getText( 'wpSearchWiki' );
|
||||
}
|
||||
|
||||
$t = Title::newFromText( trim( $this->mSearchUser ) );
|
||||
if ( $t ) {
|
||||
$this->mSearchUser = $t->getText(); // Username normalisation
|
||||
$u = User::newFromName( $this->mSearchUser );
|
||||
if ( $u ) {
|
||||
$this->mSearchUser = $u->getName(); // Username normalisation
|
||||
} elseif( IP::isIPAddress( $this->mSearchUser ) ) {
|
||||
// It's an IP
|
||||
$this->mSearchUser = IP::sanitizeIP( $this->mSearchUser );
|
||||
} else {
|
||||
$this->mSearchUser = null;
|
||||
}
|
||||
|
@ -207,7 +210,6 @@ class SpecialAbuseLog extends SpecialPage {
|
|||
$user = User::newFromName( $this->mSearchUser );
|
||||
|
||||
if ( !$user ) {
|
||||
$conds[] = 'afl_ip=afl_user_text';
|
||||
$conds['afl_user'] = 0;
|
||||
$conds['afl_user_text'] = $this->mSearchUser;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue