Discuz! X3.1 正式版含目前最新版[2014-03-01]在用戶退出時(shí)偶爾會(huì)提示如下錯(cuò)誤,Discuz! System Error 您當(dāng)前的訪問(wèn)請(qǐng)求當(dāng)中含有非法字符,已經(jīng)被系統(tǒng)拒絕錯(cuò)誤解決,下面我們就來(lái)看此問(wèn)題的解決辦法.
Discuz! X3.1 正式版含目前最新版[2014-03-01]在用戶退出時(shí)偶爾會(huì)提示如下錯(cuò)誤,特別是數(shù)據(jù)整合后的站點(diǎn).
錯(cuò)誤代碼:
Discuz! System Error 您當(dāng)前的訪問(wèn)請(qǐng)求當(dāng)中含有非法字符,已經(jīng)被系統(tǒng)拒絕.
- PHP Debug
- [Line: 0022]search.php(discuz_application->init)
- [Line: 0071]sourceclassdiscuzdiscuz_application.php(discuz_application->_init_misc)
- [Line: 0552]sourceclassdiscuzdiscuz_application.php(discuz_application->_xss_check)
- [Line: 0355]sourceclassdiscuzdiscuz_application.php(system_error)
- [Line: 0017]sourcefunctionfunction_core.php(discuz_error::system_error)
- [Line: 0024]sourceclassdiscuzdiscuz_error.php(discuz_error::debug_backtrace)
臨時(shí)解決方法:
修改 sourceclassdiscuz下的discuz_application.php文件大約第350行的private function _xss_check()方法,代碼如下:
- 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(emptyempty ($_GET['formhash'])) {
- $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');
- } else {
- $temp = '';
- }
- if(!emptyempty($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'])));//開(kāi)源軟件:Vevb.com
- if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {
- system_error('request_tainting');
- }
- return true;
- }
新聞熱點(diǎn)
疑難解答
圖片精選