南宁小站 首页 教程 discuz教程

Discuz!您当前的访问请求当中含有非法字符,已经被系统拒绝解决办法

2018-10-17 16:55

错误提示:Discuz! System Error您当前的访问请求当中含有非法字符,已经被系统拒绝PHPDebugsearch.php(discuz_application-init)source/class/discuz/discuz_application.php(discuz_application-_init_misc)source ...

错误提示:

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: 0552]source/class/discuz/discuz_application.php(discuz_application->_xss_check)
[Line: 0355]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)

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后台更新缓存,看看能解决问题么。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

粉丝 阅读203 回复0
上一篇:
DiscuzX3.2 论坛性能优化让论坛网页秒开,让网站速度更快发布时间:2018-10-17
下一篇:
专注素材教程免费分享
全国免费热线电话

400-1234-550

周一至周日9:00-23:00

反馈建议

webmaster@ibeifeng.com 在线QQ咨询

扫描二维码关注我们

Powered by Discuz! X3.2© 2001-2013 Comsenz Inc.( 桂ICP备15001943号-1 )