aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-06-29 17:05:48 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-06-30 00:46:56 +0000
commit8ec3c2650f405c2bc8246d06c6f5b5cc529db34b (patch)
treece1f76e3457d9447691a1028e9b01ecc27459ee5
parent02596df9ab06c20ea67b2362715a8b73ab35fbaa (diff)
downloadnextcloud-server-8ec3c2650f405c2bc8246d06c6f5b5cc529db34b.tar.gz
nextcloud-server-8ec3c2650f405c2bc8246d06c6f5b5cc529db34b.zip
Fix detection of firefox in ContentSecurityPolicyNonceManager
Reuse Request::USER_AGENT_FIREFOX, and also update the safari detection since safari < 12 is not supported anymore and we can remove a bit of code duplication Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r--lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
index f3329135727..1167b3358d2 100644
--- a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
+++ b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
@@ -80,10 +80,8 @@ class ContentSecurityPolicyNonceManager {
public function browserSupportsCspV3(): bool {
$browserWhitelist = [
Request::USER_AGENT_CHROME,
- // Firefox 45+
- '/^Mozilla\/5\.0 \([^)]+\) Gecko\/[0-9.]+ Firefox\/(4[5-9]|[5-9][0-9])\.[0-9.]+$/',
- // Safari 12+
- '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/(?:1[2-9]|[2-9][0-9])\.[0-9]+(?:\.[0-9]+)? Safari\/[0-9.A-Z]+$/',
+ Request::USER_AGENT_FIREFOX,
+ Request::USER_AGENT_SAFARI,
];
if ($this->request->isUserAgent($browserWhitelist)) {