Bugfix: don't set empty CSP script nonce-

This commit is contained in:
the-djmaze 2022-10-12 00:00:06 +02:00
parent 5fbca6fe48
commit 68309e5f7b

View file

@ -249,7 +249,9 @@ abstract class Service
$CSP->img[] = 'https:';
$CSP->img[] = 'http:';
}
$CSP->script[] = "'nonce-{$sScriptNonce}'";
if ($sScriptNonce) {
$CSP->script[] = "'nonce-{$sScriptNonce}'";
}
Api::Actions()->Plugins()->RunHook('main.content-security-policy', array($CSP));