dedecms源码中在互动部分有词语过滤功能,但是文章部分没有添加此功能,我们自己手动添加下发布文章禁用词语过滤功能。
打开/dede/article_add.php文件
找到
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck'))
{
$arcrank = -1;
}
在它上面加入
//词汇过滤检查
if( $cfg_notallowstr != '' )
{
if(preg_match("#".$cfg_notallowstr."#i", $title))
{
ShowMsg("title has not allow words!","-1");
exit();
}
if(preg_match("#".$cfg_notallowstr."#i", $shorttitle))
{
ShowMsg("shorttitle has not allow words!!","-1");
exit();
}
if(preg_match("#".$cfg_notallowstr."#i", $description))
{
ShowMsg("description has not allow words!","-1");
exit();
}
if(preg_match("#".$cfg_notallowstr."#i", $body))
{
ShowMsg("body has not allow words!","-1");
exit();
}