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 108
108
109
109
$ policy = apply_filters ( 'jq_content_security_policy ' , $ policy );
110
110
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 ' ) ) {
117
112
// Allow <style> in blog posts
118
113
$ policy [ 'style-src ' ] = "'self' 'unsafe-inline' code.jquery.com " ;
119
114
// Allow re-use of blog post attachments between blog.jquery.com, blog.jqueryui.com, and blog.jquerymobile.com
120
115
$ 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 " ;
121
125
}
122
126
123
127
$ policy_string = '' ;
You can’t perform that action at this time.
0 commit comments