From dc868bd83b5988350da90f7ccfc3e5205572e29b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 18 Feb 2023 15:49:04 +0100 Subject: [PATCH] getBaseUrl() checks for HTTP_X_FORWARDED_HOST and HTTP_X_FORWARDED_PROTO --- inc/inc.Utils.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index ace755d68..b33a24199 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -803,12 +803,12 @@ function getBaseUrl() { /* {{{ */ if(!empty($settings->_baseUrl)) return $settings->_baseUrl; - if(isset($_SERVER['X-Forwarded-Host'])) - $host = $_SERVER['X-Forwarded-Host']; + if(isset($_SERVER['HTTP_X_FORWARDED_HOST'])) + $host = $_SERVER['HTTP_X_FORWARDED_HOST']; else $host = $_SERVER['HTTP_HOST']; - if(isset($_SERVER['X-Forwarded-Proto'])) - $ssl = $_SERVER['X-Forwarded-Proto'] == 'https'; + if(isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) + $ssl = $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'; else $ssl = (isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0));