Skip to content

Commit

Permalink
Validate stylesheet instead of sanitizing it
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed Oct 14, 2019
1 parent 147bc17 commit bde6693
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syntax-highlighting-code-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function register_frontend_assets() {
$style = get_option( 'theme_name' );
}

$default_style_path = sprintf( 'vendor/scrivo/highlight.php/styles/%s.css', sanitize_key( $style ) );
$default_style_path = sprintf( 'vendor/scrivo/highlight.php/styles/%s.css', 0 === validate_file( $style ) ? $style : DEFAULT_THEME );
wp_register_style(
FRONTEND_STYLE_HANDLE,
plugins_url( $default_style_path, __FILE__ ),
Expand Down

0 comments on commit bde6693

Please sign in to comment.