热搜词
发表于 2014-1-3 09:54:19 | 显示全部楼层 |阅读模式
登录DZ X3.1论坛,然后退出账号时,出现如下错误提示:

Discuz! System Error
您当前的访问请求当中含有非法字符,已经被系统拒绝

PHP Debug



  • [Line: 0026]member.php(discuz_application->init)
  • [Line: 0071]source\class\discuz\discuz_application.php(discuz_application->_init_misc)
  • [Line: 0552]source\class\discuz\discuz_application.php(discuz_application->_xss_check)
  • [Line: 0355]source\class\discuz\discuz_application.php(system_error)
  • [Line: 0017]source\function\function_core.php(discuz_error::system_error)
  • [Line: 0024]source\class\discuz\discuz_error.php(discuz_error::debug_backtrace)


02.jpg
出错的网址为:
http://www.xxx.com/member.php?mod=clearcookies&formhash=0ff91285&referer


全部评论1
灰儿 发表于 2014-1-13 11:37:30 | 显示全部楼层
非官方解决办法:
FTP 进入网站根目录 找到 \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. }
复制代码


保存 OK


回复

使用道具 举报

回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|管理员之家 ( 苏ICP备2023053177号-2 )

GMT+8, 2025-1-10 20:38 , Processed in 0.153803 second(s), 25 queries .

Powered by Discuz! X3.5

Cpoyright © 2001-2025 Discuz! Team