]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/statusnet.php
Fix a UI typo which appear when using $config['site']['indent'] = null
[quix0rs-gnu-social.git] / lib / statusnet.php
index 2aa73486eb100ad996cca777f497d1509cd24bda..2c38fc205ff82ade63aa5d08af239affd01f3342 100644 (file)
@@ -107,6 +107,8 @@ class StatusNet
      */
     public static function init($server=null, $path=null, $conffile=null)
     {
+        Router::clear();
+
         StatusNet::initDefaults($server, $path);
         StatusNet::loadConfigFile($conffile);
 
@@ -141,7 +143,7 @@ class StatusNet
             return true;
         }
 
-        $sn = Status_network::staticGet($nickname);
+        $sn = Status_network::staticGet('nickname', $nickname);
         if (empty($sn)) {
             return false;
             throw new Exception("No such site nickname '$nickname'");
@@ -169,7 +171,6 @@ class StatusNet
         return $sites;
     }
 
-
     /**
      * Fire initialization events for all instantiated plugins.
      */
@@ -220,7 +221,7 @@ class StatusNet
     {
         return self::$is_api;
     }
-    
+
     public function setApi($mode)
     {
         self::$is_api = $mode;
@@ -336,8 +337,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 +369,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