From 6b1733c01c4a522b34a493df6cd1ea2df26942ee Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Wed, 29 Jul 2015 17:58:06 +0000 Subject: [PATCH] Ensure the caption shortcode outputs a valid HTML ID. fixes #33179. git-svn-id: https://develop.svn.wordpress.org/trunk@33489 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index d4b43494c7..95bbca732e 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -896,7 +896,7 @@ function img_caption_shortcode( $attr, $content = null ) { return $content; if ( ! empty( $atts['id'] ) ) - $atts['id'] = 'id="' . esc_attr( $atts['id'] ) . '" '; + $atts['id'] = 'id="' . esc_attr( sanitize_html_class( $atts['id'] ) ) . '" '; $class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] );