Don't log throttles, it should only log when the throttle is actually hit, not when it's incremented.

This commit is contained in:
Andrew Garrett 2008-09-21 13:08:10 +00:00
parent b096a714ab
commit bcca5492af

View file

@ -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;