12 三月, 2005

解决垃圾Trackback ping的临时办法

近几天,垃圾引用通告成灾,几乎所有的文章都或多或少地中了招,而且每发一片文章,立刻就会有一条新的垃圾引用通告,查看这些Spam TrackBack pings,都有一个共性,或者Title包含"poker"或"texas",或者它的链接包含这两个单词,和前些天垃圾评论非常相似。一定是某个自动程序在疯狂无聊地发送这些通告和评论。

临时没有什么好的解决办法,又不想关闭整个网站的“允许接收引用通告”的功能,所以针对垃圾引用通告的特征,在trackback.php内增加了简单的过滤代码:
(before addTrackback operation)
    $blockpattern = "poker|texas";
    if(eregi($blockpattern, $params->getValue("url")) || eregi($blockpattern, $params->getValue("blog_name")) ||
        eregi($blockpattern, $params->getValue("title")) || eregi($blockpattern, $params->getValue("excerpt"))) {
        $result = errorResponse( "Spam trackback ping probably, blocked." );
        print($result);
        TrackbackLogger::log( "Sending error response: $result" );
        TrackbackLogger::log( "** End" );
        die;
    }
测试了一下,能正常工作。

只要这个垃圾自动程序不是特别针对utblog的,那么应该能够清静一阵子。有时间的话,一定要好好处理这部分程序,特别是让plog0.32中的内容过滤功能成功运行起来。



最新回复

An apt and true reply was given to Alexander the Great by a pirate who had been seized. For when that king had asked the man what he meant by keeping hostile possession of the sea, he answered with bold pride. 'What thou meanest by seizing the whole earth; but because I do it with a petty ship, I am called a robber, whilst thou who dost it with a great fleet art styled emperor. by poker

作者 online poker 24 三月 2005, 05:35
发表评论


















Bold Italic Link