Discuz!大师网

搜索
查看: 3244|回复: 1

您当前的访问请求当中含有非法字符,已经被系统拒绝解决办法

[复制链接]
发表于 2013-12-28 16:52:59 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
解决方案如下:


\source\class\discuz的discuz_application.php
查找
  1. private function _xss_check() {

  2.                 static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');

  3.                 if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
  4.                         system_error('request_tainting');
  5.                 }

  6.                 if($_SERVER['REQUEST_METHOD'] == 'GET' ) {
  7.                         $temp = $_SERVER['REQUEST_URI'];
  8.                 } elseif(empty ($_GET['formhash'])) {
  9.                         $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');
  10.                 } else {
  11.                         $temp = '';
  12.                 }

  13.                 if(!empty($temp)) {
  14.                         $temp = strtoupper(urldecode(urldecode($temp)));
  15.                         foreach ($check as $str) {
  16.                                 if(strpos($temp, $str) !== false) {
  17.                                         system_error('request_tainting');
  18.                                 }
  19.                         }
  20.                 }

  21.                 return true;
  22.         }
复制代码


替换为:

  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');
  5.                 }
  6.                 return true;
  7.         }
复制代码
回复 马甲回复

使用道具 举报

发表于 2014-7-31 20:18:22 | 显示全部楼层
经常遇到这个问题,不知怎样解决。。。。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|网站地图|小黑屋|展会网|Discuz站长论坛 |天天打卡

GMT+8, 2024-5-8 04:12 , Processed in 0.035501 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表