syntax srror,unexpected end off file解决方法
VIEW CONTENTS
首页 建站教程 discuz教程 查看内容

syntax srror,unexpected end off file解决方法

2018-1-20 18:23| 发布者: admin| 查看: 1466| 评论: 0
discuz打开出现 syntax srror,unexpected end off file

打开文件\source\class\discuz\discuz_application.php修改这个文件
文件修改

[代码]php代码:


[代码]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;
}

4
修改为:

[代码]php代码:

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;
}




路过

雷人

握手

鲜花

鸡蛋
返回顶部