]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/statusnet.php
get the subject first if you go to the feed
[quix0rs-gnu-social.git] / lib / statusnet.php
index 7212a4a47d5ebc7db124580ccb110ff7a30ef5f4..85b46bbb3fed09904a31878c5f91caa01f5fd495 100644 (file)
@@ -169,7 +169,6 @@ class StatusNet
         return $sites;
     }
 
-
     /**
      * Fire initialization events for all instantiated plugins.
      */
@@ -220,7 +219,7 @@ class StatusNet
     {
         return self::$is_api;
     }
-    
+
     public function setApi($mode)
     {
         self::$is_api = $mode;
@@ -336,8 +335,11 @@ class StatusNet
 
         foreach ($config_files as $_config_file) {
             if (@file_exists($_config_file)) {
-                include($_config_file);
-                self::$have_config = true;
+                // Ignore 0-byte config files
+                if (filesize($_config_file) > 0) {
+                    include($_config_file);
+                    self::$have_config = true;
+                }
             }
         }
 
@@ -365,6 +367,22 @@ class StatusNet
             }
         }
     }
+
+    /**
+     * Are we running from the web with HTTPS?
+     *
+     * @return boolean true if we're running with HTTPS; else false
+     */
+
+    static function isHTTPS()
+    {
+        // There are some exceptions to this; add them here!
+        if(empty($_SERVER['HTTPS'])) {
+            return false;
+        } else {
+            return $_SERVER['HTTPS'] !== 'off';
+        }
+    }
 }
 
 class NoConfigException extends Exception