]> git.wh0rd.org Git - tt-rss.git/commitdiff
$_SERVER['HTTPS'] can be exists and 'off' for non-https connectios
authorNatan Frei <natan@debian.local>
Sun, 16 Jul 2017 21:44:48 +0000 (00:44 +0300)
committerNatan Frei <natan@debian.local>
Sun, 16 Jul 2017 21:44:48 +0000 (00:44 +0300)
include/functions.php
include/sessions.php
install/index.php

index ad6f2689ce9d9401d257eed549ef604046cada3f..ba5a699b9a64cf9986330db93cf9f1dfa8644e50 100644 (file)
        }
 
        function is_server_https() {
-               return $_SERVER['HTTPS'] == 'on' || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
+               return (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')) || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
        }
 
        function is_prefix_https() {
index 0690ab7ed0a84b5924dcbf332ddf1f0c5b365b95..3d6e6e2c627a8c1339435d259d7a54af6bd800a5 100644 (file)
@@ -12,7 +12,7 @@
        $session_expire = min(2147483647 - time() - 1, max(SESSION_COOKIE_LIFETIME, 86400));
        $session_name = (!defined('TTRSS_SESSION_NAME')) ? "ttrss_sid" : TTRSS_SESSION_NAME;
 
-       if (@$_SERVER['HTTPS'] == "on") {
+       if ((!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')) || @$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
                $session_name .= "_ssl";
                ini_set("session.cookie_secure", true);
        }
index 4239f5893f949e84f84a9de47538204cf1f8bbcd..8835730018ee9b407384b8c283c199cc4a1e043c 100755 (executable)
        }
 
        function is_server_https() {
-               return $_SERVER['HTTPS'] == 'on' || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
+               return (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')) || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
        }
 
        function make_self_url_path() {