diff --git a/wp-includes/media.php b/wp-includes/media.php index 4a0fa392a7..8808d8cd71 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1596,8 +1596,8 @@ function wp_audio_shortcode( $attr, $content = '' ) { $html_atts = array( 'class' => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ), 'id' => sprintf( 'audio-%d-%d', $post_id, $instances ), - 'loop' => $atts['loop'], - 'autoplay' => $atts['autoplay'], + 'loop' => wp_validate_boolean( $atts['loop'] ), + 'autoplay' => wp_validate_boolean( $atts['autoplay'] ), 'preload' => $atts['preload'], 'style' => 'width: 100%; visibility: hidden;', ); @@ -1822,8 +1822,8 @@ function wp_video_shortcode( $attr, $content = '' ) { 'width' => absint( $atts['width'] ), 'height' => absint( $atts['height'] ), 'poster' => esc_url( $atts['poster'] ), - 'loop' => $atts['loop'], - 'autoplay' => $atts['autoplay'], + 'loop' => wp_validate_boolean( $atts['loop'] ), + 'autoplay' => wp_validate_boolean( $atts['autoplay'] ), 'preload' => $atts['preload'], );