Skip to content

Commit

Permalink
Merge pull request #33070 from nextcloud/backport/33065/stable23
Browse files Browse the repository at this point in the history
[stable23] Fix detection of firefox in ContentSecurityPolicyNonceManager
  • Loading branch information
CarlSchwan authored Jun 30, 2022
2 parents 36aff74 + 8ec3c26 commit 26a4435
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@ public function getNonce(): string {
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)) {
Expand Down

0 comments on commit 26a4435

Please sign in to comment.