修改:content模块,content文件,add方法的
$this->db->add_content($_POST['info']);前面
//敏感词替换操作开始
$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\member\content文件的publish();
在$id = $this->content_db->add_content($info);的前面加入
//敏感词替换操作开始
$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']);
}
}
//敏感词替换结束
敏感词配置在扩展里
以上方法来自大官人,发布以求备份
评论前必须登录!
注册