Skip to content
Permalink
Browse files Browse the repository at this point in the history
Sanitize the shortcode id attribute.
  • Loading branch information
bradyvercher committed Jan 16, 2020
1 parent 768dd3d commit e3f260e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions includes/class-gistpress.php
Expand Up @@ -681,6 +681,7 @@ protected function standardize_attributes( array $rawattr ) {

// Sanitize attributes.
$attr = shortcode_atts( $defaults, $rawattr );
$attr['id'] = preg_replace( '/[^a-z0-9]+/i', '', $attr['id'] );
$attr['embed_stylesheet'] = $this->shortcode_bool( $attr['embed_stylesheet'] );
$attr['show_line_numbers'] = $this->shortcode_bool( $attr['show_line_numbers'] );
$attr['show_meta'] = $this->shortcode_bool( $attr['show_meta'] );
Expand Down

0 comments on commit e3f260e

Please sign in to comment.