解决Discuz3.2 出现“您当前的访问请求当中含有非法字符“方法
Discuz3.2 出现“您当前的访问请求当中含有非法字符“这个问题今天是第一次看到了,下面道勤小编就一起来看看这个问题的解决办法吧。错误提示:Discuz! System Error您当前的访问请求当中含有非法字符,已经被系统拒绝
PHP Debugsearch.php(discuz_application->init)
source/class/discuz/discuz_application.php(discuz_application->_init_misc)
source/class/discuz/discuz_application.php(discuz_application->_xss_check)
source/class/discuz/discuz_application.php(system_error)
source/function/function_core.php(discuz_error::system_error)
source/class/discuz/discuz_error.php(discuz_error::debug_backtrace)Discuz官方给出的解决方法:程序目录下载修改discuz_application.php代码。位置:\source\class\discuz的discuz_application.php
查找
private function _xss_check() { static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING'); if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
system_error('request_tainting');
} if($_SERVER['REQUEST_METHOD'] == 'GET' ) {
$temp = $_SERVER['REQUEST_URI'];
} elseif(empty ($_GET['formhash'])) {
$temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');
} else {
$temp = '';
} if(!empty($temp)) {
$temp = strtoupper(urldecode(urldecode($temp)));
foreach ($check as $str) {
if(strpos($temp, $str) !== false) {
system_error('request_tainting');
}
}
} return true;
}替换为: private function _xss_check() {
$temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));
if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {
system_error('request_tainting');
}
return true;
}
替换后,discuz后台更新缓存,看看能解决问题么。
页:
[1]