diff options
author | Yuchen Pei <hi@ypei.me> | 2021-09-22 17:01:58 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2021-09-22 17:01:58 +1000 |
commit | 675bcfe18906171f6fb00dd2e27d861064b28ab8 (patch) | |
tree | dfcb83319812a401f1d6be4e63faf6dc1162a24c | |
parent | 7083cc43ea352cf45d4325aaf859effd4dc4f6e9 (diff) |
updating url::getroot
otherwise things may look weird e.g. urls in confirmation email would
start with `/`
-rwxr-xr-x | h-source/Library/Url.php | 4 |
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; } |