diff options
author | rvelices <rv-github@modusoptimus.com> | 2013-06-13 18:41:32 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2013-06-13 18:41:32 +0000 |
commit | cecee258bb325b8e42413a2c0bdde07d2889c73e (patch) | |
tree | ae0949ecf3a5659297e9872b4e5eef1d1ea7e182 /include/functions_url.inc.php | |
parent | 3f610c0fd8c090d8eaaab2bad761ae487acbc5bc (diff) |
nicer urls when used over https
git-svn-id: http://piwigo.org/svn/trunk@23187 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_url.inc.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php index 787c06780..56ea858e1 100644 --- a/include/functions_url.inc.php +++ b/include/functions_url.inc.php @@ -51,9 +51,11 @@ function get_absolute_root_url($with_scheme=true) $url = ''; if ($with_scheme) { + $is_https = false; if (isset($_SERVER['HTTPS']) && - ((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1))) + ((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1))) { + $is_https = true; $url .= 'https://'; } else @@ -61,7 +63,8 @@ function get_absolute_root_url($with_scheme=true) $url .= 'http://'; } $url .= $_SERVER['HTTP_HOST']; - if ($_SERVER['SERVER_PORT'] != 80) + if ( (!$is_https && $_SERVER['SERVER_PORT'] != 80) + ||($is_https && $_SERVER['SERVER_PORT'] != 443)) { $url_port = ':'.$_SERVER['SERVER_PORT']; if (strrchr($url, ':') != $url_port) |