Skip to content

Commit e3f260e

Browse files
committed
Sanitize the shortcode id attribute.
1 parent 768dd3d commit e3f260e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

includes/class-gistpress.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ protected function standardize_attributes( array $rawattr ) {
681681

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

0 commit comments

Comments
 (0)