Discuz! System Error 您当前的访问请求当中含有非法字符

发布:2014-07-15 07:59   点击796次   评论:0

整合08cms系统:表现为,登录论坛,08cms未登录;
进而查原因,bbs所在的uc_client\data\cache\缓存没有更新;
进而调试,uc_server不能通知各app,出现提示:
“Discuz! System Error 您当前的访问请求当中含有非法字符”

==================================================================

Discuz! System Error 您当前的访问请求当中含有非法字符
www.111cn.net 编辑:swteen 来源:转载

Discuz! X3.1 正式版含目前最新版[2014-03-01]在用户退出时偶尔会提示如下错误,
Discuz! System Error 您当前的访问请求当中含有非法字符,已经被系统拒绝


Discuz! X3.1 正式版含目前最新版[2014-03-01]在用户退出时偶尔会提示如下错误,特别是数据整合后的站点:
错误代码:
Discuz! System Error 您当前的访问请求当中含有非法字符,已经被系统拒绝
PHP Debug
[Line: 0022]search.php(discuz_application->init)
[Line: 0071]sourceclassdiscuzdiscuz_application.php(discuz_application->_init_misc)
[Line: 0552]sourceclassdiscuzdiscuz_application.php(discuz_application->_xss_check)
[Line: 0355]sourceclassdiscuzdiscuz_application.php(system_error)
[Line: 0017]sourcefunctionfunction_core.php(discuz_error::system_error)
[Line: 0024]sourceclassdiscuzdiscuz_error.php(discuz_error::debug_backtrace)

临时解决方法:
修改 sourceclassdiscuz下的discuz_application.php文件大约第350行的private function _xss_check()方法:
 代码如下
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;
}

关于 GitHub 导航 部门 反馈

提示:`/home.php`入口数据仅为演示功能,不构成任何交易凭证,也不承担相关风险和责任!

Copyright © 2011-2018 xxxxx.com All rights reserved.

Run:19.674/52.557(ms); 7(sql)/2.883(MB); comm:news/detail; Upd:2025-01-11 05:05:07