mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 02:38:16 +00:00
Don't log throttles, it should only log when the throttle is actually hit, not when it's incremented.
This commit is contained in:
parent
b096a714ab
commit
bcca5492af
|
@ -205,12 +205,21 @@ class AbuseFilter {
|
|||
|
||||
// Log it
|
||||
foreach( $log_entries as $index => $entry ) {
|
||||
$log_entries[$index]['afl_actions'] = implode( ',', $doneActionsByFilter[$entry['afl_filter']] );
|
||||
$actions = $log_entries[$index]['afl_actions'] = implode( ',', $doneActionsByFilter[$entry['afl_filter']] );
|
||||
|
||||
if ($actions == 'throttle') {
|
||||
// Just a throttle, don't record it.
|
||||
unset($log_entries[$index]);
|
||||
}
|
||||
|
||||
// Increment the hit counter
|
||||
$dbw->update( 'abuse_filter', array( 'af_hit_count=af_hit_count+1' ), array( 'af_id' => $entry['afl_filter'] ), __METHOD__ );
|
||||
}
|
||||
|
||||
if (!count($log_entries)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$dbw->insert( 'abuse_filter_log', $log_entries, __METHOD__ );
|
||||
|
||||
return $display;
|
||||
|
|
Loading…
Reference in a new issue