avoid warning when HTTP_X_FORWARDED_PROTO isn't set
This commit is contained in:
parent
e0f1165b6c
commit
3061a9d7d5
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ function contact_link(): ?string
|
||||||
function is_https_enabled(): bool
|
function is_https_enabled(): bool
|
||||||
{
|
{
|
||||||
// check forwarded protocol
|
// 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';
|
$_SERVER['HTTPS']='on';
|
||||||
}
|
}
|
||||||
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
|
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
|
||||||
|
|
Reference in a new issue