Merge pull request #332 from victormacko/develop

Minor addition to HTTPS check (where it doesn't use the standard port)
This commit is contained in:
Samuel Denis-D'Ortun 2016-07-06 12:36:53 -04:00 committed by GitHub
commit 4e86794aff
1 changed files with 1 additions and 1 deletions

View File

@ -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']) . '/';