解决方案如下: 在文件\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文件即可 但是我试过了在我这里无效,不过还是提供出来,以方便其他人用, 点击下载 discuz_application.zip
|