From dfa68397063daf90a8758896693f137f9b981856 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 12 Feb 2018 22:36:33 +0000 Subject: [PATCH] Media: In `img_caption_shortcode()`, make sure `$id` and `$caption_id` are always defined. See #34595. Built from https://develop.svn.wordpress.org/trunk@42706 git-svn-id: http://core.svn.wordpress.org/trunk@42534 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index ade1114d16..8965da9ac2 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1560,6 +1560,8 @@ function img_caption_shortcode( $attr, $content = null ) { return $content; } + $id = $caption_id = $describedby = ''; + if ( $atts['id'] ) { $atts['id'] = sanitize_html_class( $atts['id'] ); $id = 'id="' . esc_attr( $atts['id'] ) . '" '; @@ -1571,8 +1573,6 @@ function img_caption_shortcode( $attr, $content = null ) { $atts['caption_id'] = 'caption-' . str_replace( '_', '-', $atts['id'] ); } - $describedby = ''; - if ( $atts['caption_id'] ) { $caption_id = 'id="' . esc_attr( $atts['caption_id'] ) . '" '; $describedby = 'aria-describedby="' . esc_attr( $atts['caption_id'] ) . '" '; diff --git a/wp-includes/version.php b/wp-includes/version.php index 2532b874e3..a281dab794 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42705'; +$wp_version = '5.0-alpha-42706'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.