From 7d534d1cda90f2058ce57440beb8b0a6e6d399f3 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Wed, 25 Feb 2015 16:19:01 -0500 Subject: [PATCH] Airtime Pro SSL compatibility hack --- airtime_mvc/application/common/HTTPHelper.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/common/HTTPHelper.php b/airtime_mvc/application/common/HTTPHelper.php index 2b6b24cee..177892e1f 100644 --- a/airtime_mvc/application/common/HTTPHelper.php +++ b/airtime_mvc/application/common/HTTPHelper.php @@ -20,10 +20,6 @@ class Application_Common_HTTPHelper public static function getStationUrl() { - $scheme = "http"; - if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') { - $scheme = "https"; - } $CC_CONFIG = Config::getConfig(); $baseUrl = $CC_CONFIG['baseUrl']; $baseDir = $CC_CONFIG['baseDir']; @@ -34,6 +30,13 @@ class Application_Common_HTTPHelper if ($baseDir[0] != "") { $baseDir = "/" . $baseDir; } + + $scheme = "http"; + if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') { + $scheme = "https"; + $basePort = "443"; //Airtime Pro compatibility hack + } + $stationUrl = "$scheme://${baseUrl}:${basePort}${baseDir}"; return $stationUrl;