修改Trackback函数防止Spam

...
function trackback_receive(&$node) {
// 处理TrackBack post 数据.
$trackback->url = check_url($_REQUEST['url']);
// 阻止trackback的spam.
$evil_words = array( 'poker', 'psxtreme', 'ramandrom', 'viagra ', 'freaky', 'howtoplay', 'holdem', 'casino', 'terashells', 'phentermine' );
//设置过滤词。
$is_not_spam = 1;
foreach ($evil_words as $reject_word) {
// 如果trackback的url,内容或是标题含有这些词汇,这个trackback将被过滤掉。
if (stristr($trackback->url, $reject_word) ||
stristr($_REQUEST['excerpt'], $reject_word) ||
stristr($_REQUEST['blog_name'], $reject_word)) {
$is_not_spam = 0;
break;
}
}
if ($is_not_spam && $trackback->url && valid_url($_REQUEST['url'], TRUE)) {
...
?>

Taxonomy upgrade extras: