From d030b717848e45e0bb5f011a1da8945de4d414c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Tue, 10 Aug 2021 16:26:24 +0800 Subject: [PATCH] * Adjust for check https. --- framework/base/router.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 0ee006df6f..e49536f612 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -609,6 +609,9 @@ class baseRouter if($this->config->framework->filterCSRF) { $httpType = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http'; + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') $httpType = 'https'; + if(isset($_SERVER['REQUEST_SCHEME']) and strtolower($_SERVER['REQUEST_SCHEME']) == 'https') $httpType = 'https'; + $httpHost = $_SERVER['HTTP_HOST']; $isAPI = (defined('RUN_MODE') && RUN_MODE == 'api') || isset($_GET[$this->config->sessionVar]); if(!$isAPI && strpos($this->server->http_referer, "$httpType://$httpHost") !== 0) $_FILES = $_POST = array();