Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twenty Nineteen: Sanitize output of custom colors CSS #8101

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/wp-content/themes/twentynineteen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function twentynineteen_editor_customizer_styles() {
if ( 'custom' === get_theme_mod( 'primary_color' ) ) {
// Include color patterns.
require_once get_parent_theme_file_path( '/inc/color-patterns.php' );
wp_add_inline_style( 'twentynineteen-editor-customizer-styles', twentynineteen_custom_colors_css() );
wp_add_inline_style( 'twentynineteen-editor-customizer-styles', wp_strip_all_tags( twentynineteen_custom_colors_css() ) );
}
}
add_action( 'enqueue_block_editor_assets', 'twentynineteen_editor_customizer_styles' );
Expand All @@ -342,7 +342,7 @@ function twentynineteen_colors_css_wrap() {
?>

<style type="text/css" id="custom-theme-colors" <?php echo is_customize_preview() ? 'data-hue="' . absint( $primary_color ) . '"' : ''; ?>>
<?php echo twentynineteen_custom_colors_css(); ?>
<?php echo wp_strip_all_tags( twentynineteen_custom_colors_css() ); ?>
</style>
<?php
}
Expand Down
Loading