]> git.p6c8.net - jirafeau.git/commitdiff
Merge branch 'master' into 'master'
authorJérôme <mojo@couak.net>
Sun, 29 Mar 2015 20:55:18 +0000 (20:55 +0000)
committerJérôme <mojo@couak.net>
Sun, 29 Mar 2015 20:55:18 +0000 (20:55 +0000)
Add the test of HTTP_X_FORWARDED_PROTO in the is_ssl function

to test the case where Jirafeau is behind an apache reverse proxy

See merge request !2

lib/functions.php

index 25464977b6eed6d2e8a2b4d3b68bafb8bb638fac..c2cad4653d209eab87a083dff6e359f90644f9d1 100644 (file)
@@ -98,6 +98,9 @@ function is_ssl() {
             return true;
     } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
         return true;
+    } elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
+        if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
+            return true;
     }
     return false;
 }

patrick-canterino.de