From: Evan Prodromou Date: Thu, 14 Oct 2010 04:16:23 +0000 (-0400) Subject: add static method StatusNet::isHTTPS() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cef10c7167dd9c6183b52a09dc9baefbf0b433cc;p=quix0rs-gnu-social.git add static method StatusNet::isHTTPS() --- diff --git a/lib/statusnet.php b/lib/statusnet.php index 7cb831696b..301994508d 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,18 @@ 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! + return $_SERVER['HTTPS']; + } } class NoConfigException extends Exception