今天登录pbootcms网站后台发现有很多垃圾留言,即使设置了验证码,依然没有效果,接下来介绍一种更为有效的方法: 找到以下目录: apps/home/controller/Messagecontroller.php 留言控制器 84 增加留言内容过滤网址、文字功能 "http","www","baidu","google","seo","+V","选购","百度","websites" 这个位置内容是要过滤的字段。
$arr = array("http","www","baidu","google","seo","+V","选购","百度","websites");
foreach($arr as $key)
{
if(strpos($mail_body,$key) > 0){
alert_back('请勿提交广告内容! \\n ERROR! \\n Reject the promotion, \\n please check the content before submitting!');
}
}
这样就会过滤掉大部分重复的广告内容了 |