Discuz! 出现“您当前的访问请求当中含有非法字符“解决方法
<br /><br /><table cellspacing="0" class="t_table" style="width:98%"><tr><td><font size="4">”您当前的访问请求当中含有非法字符,已经被系统拒绝“错误。<br /><img id="aimg_cHXVE" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" width="600" src="https://bbs.mxswl.com/data/attachment/forum/201908/25/023447tw4rzop6x6mar4ar.jpg" border="0" alt="" /> <br /></font><font size="4"><br />解决方案如下:<br /><br /><br />\source\class\discuz的discuz_application.php<br />查找<br /> <br /></font><ol><li> private function _xss_check() {<br /><li><br /><li> static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');<br /><li><br /><li> if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {<br /><li> system_error('request_tainting');<br /><li> }<br /><li><br /><li> if($_SERVER['REQUEST_METHOD'] == 'GET' ) {<br /><li> $temp = $_SERVER['REQUEST_URI'];<br /><li> } elseif(empty ($_GET['formhash'])) {<br /><li> $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');<br /><li> } else {<br /><li> $temp = '';<br /><li> }<br /><li><br /><li> if(!empty($temp)) {<br /><li> $temp = strtoupper(urldecode(urldecode($temp)));<br /><li> foreach ($check as $str) {<br /><li> if(strpos($temp, $str) !== false) {<br /><li> system_error('request_tainting');<br /><li> }<br /><li> }<br /><li> }<br /><li><br /><li> return true;<br /><li> }</ol><br /><font size="4"><br />替换为:<br /></font><ol><li> private function _xss_check() {<br /><li> $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));<br /><li> if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {<br /><li> system_error('request_tainting');<br /><li> }<br /><li> return true;<br /><li> }</ol><br /><font size="4"><br /><br />上传覆盖同名文件,后台更新缓存,重新登录退出看看是否解决了。</font><br />table<em>, </em>tr<em>, </em>td<em>, </em>当前 我这后台“运行记录”/“系统错误”中也会频繁出现这个相关的错误信息,所涉IP,大多是“<strong>北京市 阿里云</strong>”,不知何故?如楼主所发代码修改,会不会影响安全系数? <br />或多或少是有一丁点的!
頁:
[1]