PHPCMS敏感词功能修复
//敏感词替换操作开始
$this->badword_model = pc_base::load_model('badword_model');
$badword_array=$this->badword_model->select();
if(!empty($badword_array)){
foreach($badword_array as $key_index=>$badword_one){
$_POST['info']['title']=str_replace($badword_one['badword'],$badword_one['replaceword'],$_POST['info']['title']);
$_POST['info']['content']=str_replace($badword_one['badword'],$badword_one['replaceword'],$_POST['info']['content']);
}
}
//敏感词替换结束
将上述代码添加至phpcms/modules/content/content.php的add()和edit()两个方法的下述代码下方:
$this->db->edit_content($_POST['info'],$id);即可。