From 80f68760b33fd3587f60e808db5780d68930917b Mon Sep 17 00:00:00 2001 From: Roman Hergenreder Date: Fri, 26 Jun 2020 19:36:03 +0200 Subject: [PATCH] http protocol fix --- core/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.php b/core/core.php index d7b2f92..c422cb6 100644 --- a/core/core.php +++ b/core/core.php @@ -3,7 +3,7 @@ define("WEBBASE_VERSION", "0.1.0-alpha"); function getProtocol() { - return stripos($_SERVER['SERVER_PROTOCOL'], 'https') === 0 ? 'https' : 'http'; + return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http"; } function generateRandomString($length): string {