]> git.p6c8.net - jirafeau_project.git/blobdiff - lib/functions.php
Detect if HTTPS is used and adapt all links accordingly
[jirafeau_project.git] / lib / functions.php
index bc119a3a854f87af86106064089d133184a236a0..f1f89652aa586502b9e2968edbaab6517c2b0f3a 100755 (executable)
@@ -90,6 +90,18 @@ jirafeau_gen_random ($l)
     return $code;
 }
 
+function is_ssl() {
+    if ( isset($_SERVER['HTTPS']) ) {
+        if ( 'on' == strtolower($_SERVER['HTTPS']) )
+            return true;
+        if ( '1' == $_SERVER['HTTPS'] )
+            return true;
+    } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
+        return true;
+    }
+    return false;
+}
+
 function
 jirafeau_human_size ($octets)
 {

patrick-canterino.de