dedecms(本例為V57_UTF8_SP1)中在互動(dòng)部分有詞語過濾功能,但是文章部分沒有添加此功能,我們自己手動(dòng)添加下發(fā)布文章禁用詞語過濾功能。
在/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(); } }
同時(shí)修改/dede/article_edit.php中對應(yīng)代碼部分就可以了。
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。