新聞中心
Discuz!x3.1升級(jí)到20131122后,退出登錄時(shí)出現(xiàn)出現(xiàn)“您當(dāng)前的訪(fǎng)問(wèn)請(qǐng)求當(dāng)中含有非法字符“解決方法
Discuz論壇每次升級(jí)都是會(huì)夾雜著或多或少的bug的,這些都是從客戶(hù)日常使用中反饋給官方,然后官方再進(jìn)行解決處理,使得程序更加的完善,功能也越多。 這次DiscuzX3.1升級(jí)到20131122版本后,確實(shí)也出現(xiàn)了一些小bug,比如今天無(wú)憂(yōu)主機(jī)小編要講的登陸退出提示:“您當(dāng)前的訪(fǎng)問(wèn)請(qǐng)求當(dāng)中含有非法字符”,如下圖所示: [caption id="attachment_13662" align="alignnone" width="901"] discuz論壇報(bào)錯(cuò)[/caption] 解決方案如下: 在文件\source\class\discuz的discuz_application.php中 查找以下代碼: 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; } 替換為: 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_application.zip 直接解壓上傳到\source\class\discuz目錄下,替換老的discuz_application.php文件即可 相關(guān)文章推薦閱讀: DISCUZ X3.1論壇用戶(hù)退出后點(diǎn)擊清除痕跡出錯(cuò)“您當(dāng)前的訪(fǎng)問(wèn)請(qǐng)求當(dāng)中含有非法字符,已經(jīng)被系統(tǒng)拒絕”
本文地址:http://m.love62.cn/discuz/13658.html