From f229d18f2fe521357733b8308ebb7bdb31235e10 Mon Sep 17 00:00:00 2001 From: Victor Macko Date: Thu, 7 Jul 2016 01:26:35 +1000 Subject: [PATCH] Minor addition to HTTPS check (where it doesn't use the standard port) --- src/includes/functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 6fc7c29d..ec725f67 100755 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -553,7 +553,7 @@ function psm_build_url($params = array(), $urlencode = true, $htmlentities = tru if(defined('PSM_BASE_URL') && PSM_BASE_URL !== null) { $url = PSM_BASE_URL; } else { - $url = ($_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; + $url = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; // on Windows, dirname() adds both back- and forward slashes (http://php.net/dirname). // for urls, we only want the forward slashes. $url .= dirname($_SERVER['SCRIPT_NAME']) . '/';