1、装好的Discuz!搜索时 出现“您当前的访问请求当中含有非法字符,已被系统拒绝“的问题.
2、在你下的Discuz!安装程序文件夹upload 中找到下面这个文件\source\class\discuz\discuz_application.php
3、用 记事本 方式打开discuz_application.php这个文件,
4、找到下面这段代码private function _xss_check() { static $check = array('"&垆杪屑丝#39;, '>', '<', '\'', '(', ')', '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(urld髫潋啜缅ecode($_SERVER['REQUEST_URI']))); if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) { system_error('request_tainting'); } return true; }
6、替换成功后,保存文件,再把这个文件上传到你对网站对应文件夹替换成这个修改好的文件,就能实现正常搜索功能了