dz提示‘您当前的访问请求当中含有非法字符,已经被系统拒绝’解决方法教程

[复制链接]
查看5024 | 回复0 | 2020-2-18 11:46 | 显示全部楼层 |阅读模式
discuz!X论坛程序登陆退出后,另一个页面搜索或者下载之类操作会提示如下内容。
Discuz! System Error 您当前的访问请求当中含有非法字符,已经被系统拒绝
PHP Debug
[Line: 0022]search.php(discuz_application->init)
[Line: 0071]source/class/discuz/discuz_application.php(discuz_application->_init_misc)
[Line: 0558]source/class/discuz/discuz_application.php(discuz_application->_xss_check)
[Line: 0359]source/class/discuz/discuz_application.php(system_error)
[Line: 0023]source/function/function_core.php(discuz_error::system_error)
[Line: 0024]source/class/discuz/discuz_error.php(discuz_error::debug_backtrace)

如何解决这个dz问题呢,自丢网教大家友好兼容解决方法教程。
解决方案:将这个提示改为跳转用户登录
解决步奏:
打开:/source/class/discuz/discuz_application.php
搜索:
  1. if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
  2.                         system_error('request_tainting');
  3.                 }
复制代码
改为:
  1. if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
  2.                         //system_error('request_tainting');
  3.                           //header('HTTP/1.1 301 Moved Permanently');
  4.                           header("Location: https://".$_SERVER['HTTP_HOST']."/member.php?mod=logging&action=login");
  5.                           exit;
  6.                 }
复制代码
其中这里要注意的是,我们使用https作为案例,如果你的是http就改成下面代码:
  1. if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
  2.                         //system_error('request_tainting');
  3.                           //header('HTTP/1.1 301 Moved Permanently');
  4.                           header("Location: http://".$_SERVER['HTTP_HOST']."/member.php?mod=logging&action=login");
  5.                           exit;
  6.                 }
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
1
贡献
387
丢币
38902
主题
4607
回帖
116
注册时间
2018-9-25
最后登录
2024-4-16