r68535 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68534‎ | r68535 | r68536 >
Date:00:08, 25 June 2010
Author:werdna
Status:deferred
Tags:
Comment:
Merge r68534
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/AbuseFilter (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/AbuseFilter/SpecialAbuseLog.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/AbuseFilter/abusefilter.tables.sql (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/AbuseFilter/db_patches/patch-fix-indexes.sql (added) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/AbuseFilter/SpecialAbuseLog.php
@@ -100,7 +100,16 @@
101101 $conds = array();
102102
103103 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+ }
105114 }
106115
107116 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 @@
4747 afl_patrolled_by int unsigned NULL,
4848
4949 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),
5252 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)
5555 ) /*$wgDBTableOptions*/;
5656
5757 CREATE TABLE /*$wgDBprefix*/abuse_filter_history (
Property changes on: branches/wmf/1.16wmf4/extensions/AbuseFilter
___________________________________________________________________
Name: svn:mergeinfo
5858 + /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

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68534AbuseFilter: Fix mSearchUser on abuse log.werdna00:06, 25 June 2010

Status & tagging log