summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-07-26 08:54:03 +0000
committeralecpl <alec@alec.pl>2010-07-26 08:54:03 +0000
commit3a4c9f424bff7fc937334ac230217ffe5b2e246c (patch)
tree98f7e70c669dfa3a3a395f46a199c3d16dca353e /program
parentd5d968048601fa1d519f7cfee11f23918afc186c (diff)
- Support HTTP_X_FORWARDED_PROTO header for HTTPS detecting (#1486866)
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 8b8a7d23b..ff535947d 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1525,9 +1525,11 @@ function rcube_html_editor($mode='')
function rcube_https_check($port=null, $use_https=true)
{
global $RCMAIL;
-
+
if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off')
return true;
+ if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')
+ return true;
if ($port && $_SERVER['SERVER_PORT'] == $port)
return true;
if ($use_https && isset($RCMAIL) && $RCMAIL->config->get('use_https'))