From c7b1a92ebfdaa3b49d42e540daac04b033449466 Mon Sep 17 00:00:00 2001 From: djmaze Date: Tue, 14 Sep 2021 16:30:34 +0200 Subject: [PATCH] Bugfix: Undefined index: HTTP_USER_AGENT --- snappymail/v/0.0.0/app/libraries/RainLoop/Service.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php index ec04ffeae..02b7a08c2 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php @@ -215,7 +215,7 @@ class Service $sContentSecurityPolicy = \preg_replace('/(img-src[^;]+)\\shttp:(\\s|;|$)/D', '$1$2', $sContentSecurityPolicy); } // Internet Explorer does not support 'nonce' - if (!\strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/') && !\strpos($_SERVER['HTTP_USER_AGENT'], 'Edge/1')) { + if (!isset($_SERVER['HTTP_USER_AGENT']) || (!\strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/') && !\strpos($_SERVER['HTTP_USER_AGENT'], 'Edge/1'))) { if ($sScriptNonce) { $sContentSecurityPolicy = \str_replace('script-src', "script-src 'nonce-{$sScriptNonce}'", $sContentSecurityPolicy); }