File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 108108
109109 $ policy = apply_filters ( 'jq_content_security_policy ' , $ policy );
110110
111- if ( is_admin () ) {
112- // wp-admin (as used by blogs) requires inline scripts, inline styles,
113- // and workers from blob: URLs
114- $ policy [ 'script-src ' ] = "'self' 'unsafe-inline' blob: code.jquery.com " ;
115- $ policy [ 'style-src ' ] = "'self' 'unsafe-inline' code.jquery.com " ;
116- } elseif ( get_option ( 'jquery_is_blog ' ) ) {
111+ if ( get_option ( 'jquery_is_blog ' ) ) {
117112 // Allow <style> in blog posts
118113 $ policy [ 'style-src ' ] = "'self' 'unsafe-inline' code.jquery.com " ;
119114 // Allow re-use of blog post attachments between blog.jquery.com, blog.jqueryui.com, and blog.jquerymobile.com
120115 $ policy [ 'img-src ' ] = "'self' data: secure.gravatar.com code.jquery.com blog.jquery.com blog.jqueryui.com blog.jquerymobile.com " ;
116+
117+ // wp-admin requires inline scripts, inline styles, and workers from blob: URLs
118+ if ( is_admin () ) {
119+ $ policy [ 'script-src ' ] = "'self' 'unsafe-inline' blob: code.jquery.com " ;
120+ }
121+ } elseif ( is_admin () ) {
122+ // wp-admin (as used by blogs) requires inline scripts, inline styles, and workers from blob: URLs
123+ $ policy [ 'script-src ' ] = "'self' 'unsafe-inline' blob: code.jquery.com " ;
124+ $ policy [ 'style-src ' ] = "'self' 'unsafe-inline' code.jquery.com " ;
121125 }
122126
123127 $ policy_string = '' ;
You can’t perform that action at this time.
0 commit comments