From f17018962bfc6cc38a0b2ccc5f40a939f5fe49fa Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Tue, 10 Aug 2021 19:16:48 +1000 Subject: Use relative URLs instead of hardcoding domain --- h-source/Library/Helper/List.php | 2 +- h-source/Library/Helper/Menu.php | 2 +- h-source/Library/Helper/Popup.php | 4 ++-- h-source/Library/Theme.php | 6 ++---- h-source/Library/Url.php | 4 +--- 5 files changed, 7 insertions(+), 11 deletions(-) (limited to 'h-source/Library') diff --git a/h-source/Library/Helper/List.php b/h-source/Library/Helper/List.php index ba59643..57aeeff 100755 --- a/h-source/Library/Helper/List.php +++ b/h-source/Library/Helper/List.php @@ -73,7 +73,7 @@ class Helper_List extends Helper_Html { //get the generic language class $this->strings = Factory_Strings::generic(Params::$language); - $baseUrl = 'http://'.DOMAIN_NAME.'/Public/Img/Icons/elementary_2_5/'; + $baseUrl = '/Public/Img/Icons/elementary_2_5/'; //set the files of the images $this->submitImages = array( diff --git a/h-source/Library/Helper/Menu.php b/h-source/Library/Helper/Menu.php index 8fd4bf4..86ee24a 100755 --- a/h-source/Library/Helper/Menu.php +++ b/h-source/Library/Helper/Menu.php @@ -36,7 +36,7 @@ class Helper_Menu extends Helper_Html public function __construct() { - $baseUrl = "http://".DOMAIN_NAME.'/Public/Img/Icons/elementary_2_5/'; + $baseUrl = '/Public/Img/Icons/elementary_2_5/'; //get the generic language class $this->strings = Factory_Strings::generic(Params::$language); diff --git a/h-source/Library/Helper/Popup.php b/h-source/Library/Helper/Popup.php index 18bb00d..43140fe 100755 --- a/h-source/Library/Helper/Popup.php +++ b/h-source/Library/Helper/Popup.php @@ -133,10 +133,10 @@ class Helper_Popup extends Helper_Html { $returnString .= "\n"; } if (count($this->popupArray)>0) { - $returnString .= "\n"; + $returnString .= "\n"; } } return $returnString; } -} \ No newline at end of file +} diff --git a/h-source/Library/Theme.php b/h-source/Library/Theme.php index 10c0fce..fe938ee 100755 --- a/h-source/Library/Theme.php +++ b/h-source/Library/Theme.php @@ -39,11 +39,9 @@ class Theme { function __construct($controller) { - $protocol = Params::$useHttps ? "https" : "http"; - $this->controller = $controller; - $this->baseUrl = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME : "$protocol://" . DOMAIN_NAME . '/index.php'; - $this->baseUrlSrc = "$protocol://" . DOMAIN_NAME; + $this->baseUrl = MOD_REWRITE_MODULE === true ? '': '/index.php'; + $this->baseUrlSrc = ''; } diff --git a/h-source/Library/Url.php b/h-source/Library/Url.php index efb8e6e..5124047 100755 --- a/h-source/Library/Url.php +++ b/h-source/Library/Url.php @@ -27,9 +27,7 @@ class Url { //get the url starting from the root folder public static function getRoot($pathFromRootFolder = null) { - $protocol = Params::$useHttps ? "https" : "http"; - - $url = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME . '/' . $pathFromRootFolder : "$protocol://" . DOMAIN_NAME . '/index.php/' . $pathFromRootFolder; + $url = MOD_REWRITE_MODULE === true ? '/' . $pathFromRootFolder : '/index.php/' . $pathFromRootFolder; return $url; } -- cgit v1.2.3