]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/statusnet.php
Introduced isCurrentProfileInScope() which shall check if current profile is
[quix0rs-gnu-social.git] / lib / statusnet.php
index a9b05388c393f6e0e6a4a51c55c96407a2a08845..844a15c339d10cc8ab363ef296c366ccba1c5963 100644 (file)
@@ -423,11 +423,20 @@ class StatusNet
     static function isHTTPS()
     {
         // There are some exceptions to this; add them here!
-        if(empty($_SERVER['HTTPS'])) {
+        if (empty($_SERVER['HTTPS'])) {
             return false;
-        } else {
-            return $_SERVER['HTTPS'] !== 'off';
         }
+
+        // If it is _not_ "off", it is on, so "true".
+        return strtolower($_SERVER['HTTPS']) !== 'off';
+    }
+
+    /**
+     * Can we use HTTPS? Then do! Only return false if it's not configured ("never").
+     */
+    static function useHTTPS()
+    {
+        return self::isHTTPS() || common_config('site', 'ssl') != 'never';
     }
 }