Index: branches/wmf/1.16wmf4/extensions/AbuseFilter/SpecialAbuseLog.php |
— | — | @@ -100,7 +100,16 @@ |
101 | 101 | $conds = array(); |
102 | 102 | |
103 | 103 | if ( $this->mSearchUser ) { |
104 | | - $conds['afl_user_text'] = $this->mSearchUser; |
| 104 | + $user = User::newFromName( $this->mSearchUser ); |
| 105 | + |
| 106 | + if ( !$user ) { |
| 107 | + $conds[] = 'afl_ip=afl_user_text'; |
| 108 | + $conds['afl_user'] = 0; |
| 109 | + $conds['afl_user_text'] = $this->mSearchUser; |
| 110 | + } else { |
| 111 | + $conds['afl_user'] = $user->getId(); |
| 112 | + $conds['afl_user_text'] = $user->getName(); |
| 113 | + } |
105 | 114 | } |
106 | 115 | |
107 | 116 | if ( $this->mSearchFilter ) { |
Index: branches/wmf/1.16wmf4/extensions/AbuseFilter/db_patches/patch-fix-indexes.sql |
— | — | @@ -0,0 +1,18 @@ |
| 2 | +-- Fixes abuse_filter_log indices. |
| 3 | + |
| 4 | +--# PRIMARY KEY (afl_id), |
| 5 | +--# KEY (afl_filter,afl_timestamp), |
| 6 | +--# KEY (afl_user,afl_user_text,afl_timestamp), |
| 7 | +--# KEY (afl_timestamp), |
| 8 | +--# KEY (afl_namespace, afl_title, afl_timestamp), |
| 9 | +--# KEY (afl_ip, afl_timestamp) |
| 10 | + |
| 11 | +ALTER TABLE /*_*/abuse_filter_log ADD KEY filter_timestamp (afl_filter,afl_timestamp); |
| 12 | +ALTER TABLE /*_*/abuse_filter_log ADD KEY user_timestamp (afl_user,afl_user_text,afl_timestamp); |
| 13 | +ALTER TABLE /*_*/abuse_filter_log ADD KEY page_timestamp (afl_namespace, afl_title, afl_timestamp); |
| 14 | +ALTER TABLE /*_*/abuse_filter_log ADD KEY ip_timestamp (afl_ip, afl_timestamp); |
| 15 | + |
| 16 | +ALTER TABLE /*_*/abuse_filter_log DROP KEY afl_filter; |
| 17 | +ALTER TABLE /*_*/abuse_filter_log DROP KEY afl_user; |
| 18 | +ALTER TABLE /*_*/abuse_filter_log DROP KEY afl_namespace; |
| 19 | +ALTER TABLE /*_*/abuse_filter_log DROP KEY afl_ip; |
Index: branches/wmf/1.16wmf4/extensions/AbuseFilter/abusefilter.tables.sql |
— | — | @@ -46,11 +46,11 @@ |
47 | 47 | afl_patrolled_by int unsigned NULL, |
48 | 48 | |
49 | 49 | PRIMARY KEY (afl_id), |
50 | | - KEY (afl_filter), |
51 | | - KEY (afl_user), |
| 50 | + KEY filter_timestamp (afl_filter,afl_timestamp), |
| 51 | + KEY user_timestamp (afl_user,afl_user_text,afl_timestamp), |
52 | 52 | KEY (afl_timestamp), |
53 | | - KEY (afl_namespace, afl_title), |
54 | | - KEY (afl_ip) |
| 53 | + KEY page_timestamp (afl_namespace, afl_title, afl_timestamp), |
| 54 | + KEY ip_timestamp (afl_ip, afl_timestamp) |
55 | 55 | ) /*$wgDBTableOptions*/; |
56 | 56 | |
57 | 57 | CREATE TABLE /*$wgDBprefix*/abuse_filter_history ( |
Property changes on: branches/wmf/1.16wmf4/extensions/AbuseFilter |
___________________________________________________________________ |
Name: svn:mergeinfo |
58 | 58 | + /branches/wmf-deployment/extensions/AbuseFilter:60970 |
/trunk/extensions/AbuseFilter:68534 |
/trunk/phase3/extensions/AbuseFilter:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816 |