Board logo

标题: [软件故障] DZ反代后发帖等时提示“您的请求来路不正确,无法提交。”的解决方法 [打印本页]

作者: shillan    时间: 2020-12-1 10:32     标题: DZ反代后发帖等时提示“您的请求来路不正确,无法提交。”的解决方法

现象:DZ反向代理后,发帖及回帖等时提示:
您的请求来路不正确,无法提交。

解决:include\global.func.php的函数submitcheck()中:
                if($allowget || ($_SERVER['REQUEST_METHOD'] == 'POST' && $GLOBALS['formhash'] == formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) ||
                        preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST']))))

修改为:
        if($allowget || ($_SERVER['REQUEST_METHOD'] == 'POST' && $GLOBALS['formhash'] == formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) ||
                        preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST']) ||
'www.abc.com' == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])
)))

其中,www.abc.com是被代理服务器的真实域名。




欢迎光临 逐梦论坛 (http://temp2023.zhumeng.org/) Powered by Discuz! 7.2