一个资源分享、信息整合的综合性站点。

标题: discuz出现syntax srror,unexpected end off file问题的解决方法 [打印本页]

作者: 树苗收集系    时间: 2019-11-26 22:06
标题: discuz出现syntax srror,unexpected end off file问题的解决方法
discuz打开出现 syntax srror,unexpected end off file

打开文件[color=#ff0000]\source\class\discuz\discuz_application.php[/color]修改这个文件
文件修改
[code]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;
}[/code]修改为:
[code]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;
}[/code]



作者: 我是月亮无太阳    时间: 2021-3-8 07:35
非常不错,感谢分享!
作者: 红颜纷扰红尘    时间: 2022-6-18 17:04
抢楼了,前排第一次啊




欢迎光临 一个资源分享、信息整合的综合性站点。 (https://www.sorv.cn/) Powered by Discuz! X3.4