aboutsummaryrefslogtreecommitdiff
path: root/h-source
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2021-09-22 17:01:58 +1000
committerYuchen Pei <hi@ypei.me>2021-09-22 17:01:58 +1000
commit675bcfe18906171f6fb00dd2e27d861064b28ab8 (patch)
treedfcb83319812a401f1d6be4e63faf6dc1162a24c /h-source
parent7083cc43ea352cf45d4325aaf859effd4dc4f6e9 (diff)
updating url::getroot
otherwise things may look weird e.g. urls in confirmation email would start with `/`
Diffstat (limited to 'h-source')
-rwxr-xr-xh-source/Library/Url.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/h-source/Library/Url.php b/h-source/Library/Url.php
index 5124047..efb8e6e 100755
--- a/h-source/Library/Url.php
+++ b/h-source/Library/Url.php
@@ -27,7 +27,9 @@ class Url {
//get the url starting from the root folder
public static function getRoot($pathFromRootFolder = null) {
- $url = MOD_REWRITE_MODULE === true ? '/' . $pathFromRootFolder : '/index.php/' . $pathFromRootFolder;
+ $protocol = Params::$useHttps ? "https" : "http";
+
+ $url = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME . '/' . $pathFromRootFolder : "$protocol://" . DOMAIN_NAME . '/index.php/' . $pathFromRootFolder;
return $url;
}