| 1 |
<?php |
<?php |
| 2 |
// $Id: spam.module,v 1.51.4.1.2.41.2.30.2.14 2009/08/06 16:00:27 jeremy Exp $ |
// $Id: spam.module,v 1.51.4.1.2.41.2.30.2.15 2009/08/06 21:06:49 jeremy Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 161 |
if (!$counter) { |
if (!$counter) { |
| 162 |
spam_log(SPAM_VERBOSE, 'spam_content_filter', t('No filters enabled for group !gid, content not scanned.', array('!gid' => $gid)), $type, $id); |
spam_log(SPAM_VERBOSE, 'spam_content_filter', t('No filters enabled for group !gid, content not scanned.', array('!gid' => $gid)), $type, $id); |
| 163 |
} |
} |
| 164 |
if ($id) { |
if ($total) { |
| 165 |
if ($total) { |
$log_score = spam_sanitize_score($score / $total); |
|
$scores["$type-$id"] = spam_sanitize_score($score / $total); |
|
|
} |
|
|
else { |
|
|
$scores["$type-$id"] = 1; |
|
|
} |
|
| 166 |
} |
} |
| 167 |
else { |
else { |
| 168 |
// Don't cache if we don't have an ID, as we may scan multiple pieces |
$log_score = 1; |
| 169 |
// of content without an ID. Update the score, however, for logging |
} |
| 170 |
// purposes. |
if ($id) { |
| 171 |
if ($total) { |
$scores["$type-$id"] = $log_score; |
|
$log_score = spam_sanitize_score($score / $total); |
|
|
} |
|
|
else { |
|
|
$log_score = 1; |
|
|
} |
|
| 172 |
} |
} |
| 173 |
} |
} |
| 174 |
else { |
else { |
| 191 |
} |
} |
| 192 |
spam_update_statistics(t('detected spam')); |
spam_update_statistics(t('detected spam')); |
| 193 |
spam_update_statistics(t('content_filter redirect')); |
spam_update_statistics(t('content_filter redirect')); |
| 194 |
spam_log(SPAM_VERBOSE, 'spam_content_filter', t('Spam score [!score], redirecting to: !url', array('!score' => (isset($scores["$type-$id"]) ? $scores["$type-$id"] : $log_score), '!url' => $redirect)), $type, $id); |
spam_log(SPAM_VERBOSE, 'spam_content_filter', t('Spam score [!score], redirecting to: !url', array('!score' => $log_score, '!url' => $redirect)), $type, $id); |
| 195 |
drupal_goto($redirect); |
drupal_goto($redirect); |
| 196 |
} |
} |
| 197 |
} |
} |