Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 68309e5

Browse files
author
the-djmaze
committed
Bugfix: don't set empty CSP script nonce-
1 parent 5fbca6f commit 68309e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

snappymail/v/0.0.0/app/libraries/RainLoop/Service.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ private static function setCSP(string $sScriptNonce = null) : void
249249
$CSP->img[] = 'https:';
250250
$CSP->img[] = 'http:';
251251
}
252-
$CSP->script[] = "'nonce-{$sScriptNonce}'";
252+
if ($sScriptNonce) {
253+
$CSP->script[] = "'nonce-{$sScriptNonce}'";
254+
}
253255

254256
Api::Actions()->Plugins()->RunHook('main.content-security-policy', array($CSP));
255257

0 commit comments

Comments
 (0)