From 3663a276f1e184c7d3bc1d55085e3204d1890c6d Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 3 Nov 2014 05:02:18 +0000 Subject: [PATCH] In `wp_audio|video_shortcode()`, make sure that `autoplay` and `loop` are booleans. Passing `'false'` to them will force them to be active, which is bad. Fixes #29825. git-svn-id: https://develop.svn.wordpress.org/trunk@30185 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 0c3fd2251f..aa6a724814 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -1575,8 +1575,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;', ); @@ -1801,8 +1801,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'], );