From 3061a9d7d5d1e73b3ea4c955aa4b6efd18f00153 Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 1 Jan 2022 10:29:32 +0000 Subject: [PATCH] avoid warning when HTTP_X_FORWARDED_PROTO isn't set --- core/util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/util.php b/core/util.php index 8b20139d..80a86894 100644 --- a/core/util.php +++ b/core/util.php @@ -66,7 +66,7 @@ function contact_link(): ?string function is_https_enabled(): bool { // check forwarded protocol - if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { + if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { $_SERVER['HTTPS']='on'; } return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');