- fix HTTPS checking (#1486273)

release-0.6
alecpl 15 years ago
parent 1cf86b731c
commit 3ea30ef7eb

@ -51,8 +51,8 @@ if (set_include_path($include_path) === false) {
} }
ini_set('error_reporting', E_ALL&~E_NOTICE); ini_set('error_reporting', E_ALL&~E_NOTICE);
if (isset($_SERVER['HTTPS'])) { if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') {
ini_set('session.cookie_secure', ($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off'))?1:0); ini_set('session.cookie_secure', 1);
} else { } else {
ini_set('session.cookie_secure', 0); ini_set('session.cookie_secure', 0);
} }

@ -1410,7 +1410,7 @@ function rcube_https_check($port=null, $use_https=true)
{ {
global $RCMAIL; global $RCMAIL;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off')
return true; return true;
if ($port && $_SERVER['SERVER_PORT'] == $port) if ($port && $_SERVER['SERVER_PORT'] == $port)
return true; return true;

@ -1063,7 +1063,7 @@ class rcmail
{ {
$cookie = session_get_cookie_params(); $cookie = session_get_cookie_params();
setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'],
($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off'))); rcube_https_check());
} }
} }

Loading…
Cancel
Save