- 记录
- 相册
- 主题
- 分享
- 精华
- 积分
- 43494
- 好友
- 注册时间
- 2013-10-12
- 帖子
- 互助币
- 枚
- 爱心币
- 枚
- 经验值
- 点
- 贡献值
- 点
- 水表量
- 升
- 推广币
- 元
- 最后登录
- 1970-1-1
- 在线时间
- 小时
|
相信这种问题discuz站长遇到的也很多,下面就来说下出现了这个问题还如何解决
解决方案
查找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;
- }
复制代码
后台更新下缓存,看看是不是已经解决了该问题
|
|