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'");
return $sites;
}
-
/**
* Fire initialization events for all instantiated plugins.
*/
{
return self::$is_api;
}
-
+
public function setApi($mode)
{
self::$is_api = $mode;
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;
+ }
}
}
}
}
}
+
+ /**
+ * 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