Skip to content

Commit 99aa428

Browse files
committed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugins/jquery-filters.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
$report_url = 'https://csp-report-api.openjs-foundation.workers.dev/';
8686
$policy = array(
8787
'default-src' => "'self'",
88-
'script-src' => "'self' 'nonce-$nonce' code.jquery.com",
8988
// The nonce is here so inline scripts can be used in the theme
89+
'script-src' => "'self' 'nonce-$nonce' code.jquery.com",
9090
'style-src' => "'self' 'nonce-$nonce' code.jquery.com",
9191
// Allow style="" attributes in blog posts and markdown.
9292
'style-src-attr' => "'unsafe-inline'",
@@ -113,6 +113,9 @@
113113
// and workers from blob: URLs
114114
$policy[ 'script-src' ] = "'self' 'unsafe-inline' blob: code.jquery.com";
115115
$policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com";
116+
} elseif ( get_option( 'jquery_is_blog' ) ) {
117+
// Allow <style> in blog posts
118+
$policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com";
116119
}
117120

118121
$policy_string = '';

0 commit comments

Comments
 (0)