From 854c2117580f5fec8302c991509e028d3b966778 Mon Sep 17 00:00:00 2001 From: qronald Date: Fri, 10 Feb 2017 13:50:52 -0400 Subject: [PATCH] HOR-2673 --- gulliver/system/class.g.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 39e22b3ff..e60db1d1f 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -45,19 +45,16 @@ class G /** * is_https - * @return void - */ + * @return bool + */ public static function is_https() { - if (isset($_SERVER['HTTPS'])) { - if ($_SERVER['HTTPS']=='on') { - return true; - } else { - return false; - } - } else { - return false; + $is_http = false; + if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') || + (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) { + $is_http = true; } + return $is_http; } /**