X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fstatusnet.php;h=85b46bbb3fed09904a31878c5f91caa01f5fd495;hb=119d0f7dbab40f30170ba263de78d7e9cea984db;hp=7cb831696bc02ac512a69f6190469242227371c4;hpb=04f3f57e2eed2a7757b3dd2bf5afc4926dd0961b;p=quix0rs-gnu-social.git diff --git a/lib/statusnet.php b/lib/statusnet.php index 7cb831696b..85b46bbb3f 100644 --- a/lib/statusnet.php +++ b/lib/statusnet.php @@ -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; @@ -368,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