Skip to content

Commit

Permalink
jqueryui.com: add CSP exceptions for download builder
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Dec 15, 2024
1 parent 239b9f3 commit e5a9218
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions themes/jqueryui.com/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
require_once __DIR__ . '/functions.content.php';

// Allow inline scripts on https://jqueryui.com/themeroller/
// Load scripts from download.jqueryui.com on https://jqueryui.com/download/
// Load styles from download.jqueryui.com on https://jqueryui.com/themeroller/
// Load images from download.jqueryui.com on https://jqueryui.com/themeroller/
// Allow form actions to download.jqueryui.com on https://jqueryui.com/download/
add_filter( 'jq_content_security_policy', function ( $policy ) {
$policy[ 'script-src' ] = "'self' code.jquery.com download.jqueryui.com";
$policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com download.jqueryui.com";
$policy[ 'img-src' ] = "'self' data: code.jquery.com download.jqueryui.com";
$policy[ 'form-action' ] = "'self' download.jqueryui.com";
return $policy;
} );

0 comments on commit e5a9218

Please sign in to comment.