Discuz! 您当前的访问请求当中含有非法字符
创始人
2026-04-01 15:22:16
0

轻松解决 Discuz!  搜索时 出现“Discuz! System Error 您当前的访问请求当中含有非法字符,已被系统拒绝“的问题

方法/步骤:

1) 装好的Discuz! 搜索时 出现“您当前的访问请求当中含有非法字符,已被系统拒绝“的问题.

2) 在你下的Discuz! 安装程序文件夹 upload  中找到下面这个文件 \source\class\discuz\discuz_application.php

3) 用 记事本 方式打开discuz_application.php这个文件,

4)


找到下面这段代码

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;

        }


5)

替换成下面这段代码

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! 您当前的访...
轻松解决 Discuz! 搜索时 出现“Discuz! Syst...
2026-04-01 15:22:16

热门资讯

Discuz! 您当前的访问请... 轻松解决 Discuz! 搜索时 出现“Discuz! System Error 您当前的访问请求...