宏博网络 | 专注互联网品牌一站式服务

Thank you for visiting

029-81773686

全网开发&整合营销服务商

CopyRight
©HOOBOO All rights reserved

全网开发&整合营销服务商

029-81773686

discuz升级造成的“您当前的访问请求当中含有非法字符”

2014.04.14


解决方案:
\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掌上论坛独立版宣传页出现乱码

CopyRight © 西安宏博网络科技有限公司   备案号:陕ICP备10007014号-8   站点地图 免责声明:本网站部分资源来源于网络,如有侵权,请联系我们告知删除,我们将会尽快处理,谢谢!本站不承担任何法律责任。