File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
lib/public/AppFramework/Http Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 3737 * @since 9.0.0
3838 */
3939class EmptyContentSecurityPolicy {
40- /** @var string JS nonce to be used */
41- protected $ jsNonce = null ;
40+ /** @var ? string JS nonce to be used */
41+ protected ? string $ jsNonce = null ;
4242 /** @var bool Whether strict-dynamic should be used */
4343 protected $ strictDynamicAllowed = null ;
4444 /** @var bool Whether strict-dynamic should be used on script-src-elem */
@@ -460,7 +460,7 @@ public function buildPolicy() {
460460 $ policy .= "base-uri 'none'; " ;
461461 $ policy .= "manifest-src 'self'; " ;
462462
463- if (!empty ($ this ->allowedScriptDomains ) || $ this ->evalScriptAllowed || $ this ->evalWasmAllowed ) {
463+ if (!empty ($ this ->allowedScriptDomains ) || $ this ->evalScriptAllowed || $ this ->evalWasmAllowed || is_string ( $ this -> jsNonce ) ) {
464464 $ policy .= 'script-src ' ;
465465 $ scriptSrc = '' ;
466466 if (is_string ($ this ->jsNonce )) {
You can’t perform that action at this time.
0 commit comments