discuz 搜索時“您當前的訪問請求當中含有非法字符,已經被系統拒絕”
Discuz!x3.1故障描述:垃圾站博主發現升級Discuz! x3.1版本后,退出登錄或以游客狀態搜索時出現“您當前的訪問請求當中含有非法字符,已經被系統拒絕”的錯誤。
解決方案如下:sourceclassdiscuz的discuz_application.php 查找
1 | private function _xss_check() { |
3 | static $check = array ( '"' , '>' , '<' , ''' , '(' , ')' , 'CONTENT-TRANSFER-ENCODING' ); |
5 | if (isset( $_GET [ 'formhash' ]) && $_GET [ 'formhash' ] !== formhash()) { |
6 | system_error( 'request_tainting' ); |
9 | if ( $_SERVER [ 'REQUEST_METHOD' ] == 'GET' ) { |
10 | $temp = $_SERVER [ 'REQUEST_URI' ]; |
11 | } elseif ( empty ( $_GET [ 'formhash' ])) { |
12 | $temp = $_SERVER [ 'REQUEST_URI' ]. file_get_contents ( 'php://input' ); |
18 | $temp = strtoupper (urldecode(urldecode( $temp ))); |
19 | foreach ( $check as $str ) { |
20 | if ( strpos ( $temp , $str ) !== false) { |
21 | system_error( 'request_tainting' ); |
替換為:
1 | private function _xss_check() { |
2 | $temp = strtoupper (urldecode(urldecode( $_SERVER [ 'REQUEST_URI' ]))); |
3 | if ( strpos ( $temp , '<' ) !== false || strpos ( $temp , '"' ) !== false || strpos ( $temp , 'CONTENT-TRANSFER-ENCODING' ) !== false) { |
4 | system_error( 'request_tainting' ); |
-
售前咨詢
售前咨詢服務時間:09:00-23:30
售前值班
4006-75-4006
咨詢熱線:
4006-75-4006(09:00-23:30)
0871-6388 6388 (總機)(工作日 09:00-18:00)
-
售后咨詢
售后咨詢服務時間:00:00-24:00
24H值班技術
4006-75-4006
-
備案咨詢
備案咨詢服務時間:09:00-18:00(工作日)
備案專業客服
0871-6388 6388
-
電話
0871-6388 6388 (總機)
- 工單
-
二維碼
-
TOP