From 78645d5145bcb36a4c7a7f2437f90241b8cd2bdb Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 25 May 2023 14:33:58 +0800 Subject: [PATCH] * Fix $_SERVER error for unit test. --- module/common/model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/common/model.php b/module/common/model.php index 62a3ee378c..5f6bd9de32 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2867,6 +2867,8 @@ EOF; */ public static function getSysURL() { + if(defined('RUN_MODE') && RUN_MODE == 'test') return ''; + $httpType = (isset($_SERVER["HTTPS"]) and $_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';