/** * Returns true if this is a secure connection. * * @return true */ public static function secureConnection() { if (self::$secure === null) { self::$secure = false; if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' || $_SERVER['SERVER_PORT'] == 443) { self::$secure = true; } } return self::$secure; }
/** * Returns true if this is a secure connection. * * @return true */ public static function secureConnection() { if (self::$secure === null) { self::$secure = false; if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' || $_SERVER['SERVER_PORT'] == 443 || !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { self::$secure = true; } } return self::$secure; }