aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_url.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2009-06-09 15:55:21 +0000
committernikrou <nikrou@piwigo.org>2009-06-09 15:55:21 +0000
commit50114c64f086bf55eae516e734d8f8d56fb5f6dc (patch)
tree4f50f554401dbda9510e81f304880c77d630d3b1 /include/functions_url.inc.php
parentccc032c8092ff020ac1b928bba891582e7659019 (diff)
merge from trunk;bug fix 1024 : the way to discover protocol (http/https) was not correct
git-svn-id: http://piwigo.org/svn/branches/2.0@3404 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_url.inc.php')
-rw-r--r--include/functions_url.inc.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index 49e3fa429..6993aae75 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -58,13 +58,14 @@ function get_absolute_root_url($with_scheme=true)
$url = '';
if ($with_scheme)
{
- if (empty($_SERVER['HTTPS']))
+ if (isset($_SERVER['HTTPS']) &&
+ ((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1)))
{
- $url .= 'http://';
+ $url .= 'https://';
}
else
{
- $url .= 'https://';
+ $url .= 'http://';
}
$url .= $_SERVER['HTTP_HOST'];
if ($_SERVER['SERVER_PORT'] != 80)