From 3ea30ef7ebb7aa6180a47db29575055dd97cff62 Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 4 Nov 2009 07:22:17 +0000 Subject: - fix HTTPS checking (#1486273) --- program/include/iniset.php | 4 ++-- program/include/main.inc | 2 +- program/include/rcmail.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'program') diff --git a/program/include/iniset.php b/program/include/iniset.php index 1332c8d0e..2600a394a 100755 --- a/program/include/iniset.php +++ b/program/include/iniset.php @@ -51,8 +51,8 @@ if (set_include_path($include_path) === false) { } ini_set('error_reporting', E_ALL&~E_NOTICE); -if (isset($_SERVER['HTTPS'])) { - ini_set('session.cookie_secure', ($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off'))?1:0); +if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { + ini_set('session.cookie_secure', 1); } else { ini_set('session.cookie_secure', 0); } diff --git a/program/include/main.inc b/program/include/main.inc index aa0d3fa26..258f719ce 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1410,7 +1410,7 @@ function rcube_https_check($port=null, $use_https=true) { global $RCMAIL; - if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') + if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') return true; if ($port && $_SERVER['SERVER_PORT'] == $port) return true; diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 763c70889..2c002b15c 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -1063,7 +1063,7 @@ class rcmail { $cookie = session_get_cookie_params(); setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], - ($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off'))); + rcube_https_check()); } } -- cgit v1.2.3