dedecms(本例为V57_UTF8_SP1)中在互动部分有词语过滤功能,但是文章部分没有添加此功能,我们自己手动添加下发布文章禁用词语过滤功能。

织梦发布文章添加禁用词语过滤功能

在/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();

        }

    }

同时修改/dede/article_edit.php中对应代码部分就可以了。

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。