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
This commit is contained in:
Helen Hou-Sandi 2015-07-29 17:58:06 +00:00
parent dbcb95c022
commit 6b1733c01c

View File

@ -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'] );