From b7f3513d7e88f67c795373f47c66ce6337ebd147 Mon Sep 17 00:00:00 2001 From: nikrou Date: Tue, 9 Jun 2009 15:47:47 +0000 Subject: bug fix 1024 : the way to discover protocol (http/https) was not correct git-svn-id: http://piwigo.org/svn/trunk@3403 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_url.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/functions_url.inc.php') 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) -- cgit v1.2.3