本文主要讲解《为dedecms织梦模板发布文章添加禁用词语过滤功能》的详细内容
dedecms(本例为V57_UTF8_SP1)中在互动部分有词语过滤功能,但是文章部分没有添加此功能,我们自己手动添加下发布文章禁用词语过滤功能。
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(); } } |
本网刊登的文章均仅代表作者个人观点,并不代表本网立场。文中的论述和观点,敬请读者注意判断。
2021-02-24
2021-02-08
2021-02-08
2021-02-08
2021-02-08
2021-02-08
2021-02-24
2021-02-08