aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_url.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions_url.inc.php')
-rw-r--r--include/functions_url.inc.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index 99d30acf5..fb94cb4b4 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -60,7 +60,15 @@ function get_absolute_root_url($with_scheme=true)
$url = '';
if ($with_scheme)
{
- $url .= 'http://'.$_SERVER['HTTP_HOST'];
+ if (empty($_SERVER['HTTPS']))
+ {
+ $url .= 'http://';
+ }
+ else
+ {
+ $url .= 'https://';
+ }
+ $url .= $_SERVER['HTTP_HOST'];
if ($_SERVER['SERVER_PORT'] != 80)
{
$url_port = ':'.$_SERVER['SERVER_PORT'];