| 1 |
<?php |
<?php |
| 2 |
// $Id: spam.module,v 1.51.4.1.2.41.2.30.2.13 2009/08/05 16:24:06 jeremy Exp $ |
// $Id: spam.module,v 1.51.4.1.2.41.2.30.2.14 2009/08/06 16:00:27 jeremy Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 169 |
$scores["$type-$id"] = 1; |
$scores["$type-$id"] = 1; |
| 170 |
} |
} |
| 171 |
} |
} |
| 172 |
|
else { |
| 173 |
|
// Don't cache if we don't have an ID, as we may scan multiple pieces |
| 174 |
|
// of content without an ID. Update the score, however, for logging |
| 175 |
|
// purposes. |
| 176 |
|
if ($total) { |
| 177 |
|
$log_score = spam_sanitize_score($score / $total); |
| 178 |
|
} |
| 179 |
|
else { |
| 180 |
|
$log_score = 1; |
| 181 |
|
} |
| 182 |
|
} |
| 183 |
} |
} |
| 184 |
else { |
else { |
| 185 |
spam_log(SPAM_VERBOSE, 'spam_content_filter', t('No main filter field defined, skipping. Returned fields: !fields', array('!fields' => implode(', ', $fields))), $type, $id); |
spam_log(SPAM_VERBOSE, 'spam_content_filter', t('No main filter field defined, skipping. Returned fields: !fields', array('!fields' => implode(', ', $fields))), $type, $id); |
| 201 |
} |
} |
| 202 |
spam_update_statistics(t('detected spam')); |
spam_update_statistics(t('detected spam')); |
| 203 |
spam_update_statistics(t('content_filter redirect')); |
spam_update_statistics(t('content_filter redirect')); |
| 204 |
spam_log(SPAM_VERBOSE, 'spam_content_filter', t('Spam score [!score], redirecting to: !url', array('!score' => $scores["$type-$id"], '!url' => $redirect)), $type, $id); |
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); |
| 205 |
drupal_goto($redirect); |
drupal_goto($redirect); |
| 206 |
} |
} |
| 207 |
} |
} |