discuz教程

"您当前访问请求中含有非法字符" 友好兼容解决方案

discuz教程 admin 2021-01-03 人阅读

问题描述:由于Discuz!X 的Xss安全机制,会对游客访问时进行字符内容安全检查,特别是游客使用搜索功能时,搜索容易出现 "您当前访问请求中含有非法字符",已被系统拒绝" 。7IA

7IA

解决方案:将这个提示改为跳转用户登录7IA

解决步奏:7IA

打开:/source/class/discuz/discuz_application.php7IA

搜索:7IA

if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
                        system_error('request_tainting');
                }

改为:7IA

if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
                        //system_error('request_tainting');
                          //header('HTTP/1.1 301 Moved Permanently');
                          header("Location: https://".$_SERVER['HTTP_HOST']."/member.php?mod=logging&action=login");
                          exit;
                }

备注:https根据实际情况修改http7IA

版权声明:文章搜集于网络,如有侵权请联系本站,转载请说明出处:https://www.51yma.cn/jiaocheng/discuz/198.html
文章来源: