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.

Merges [30185] to the 4.0 branch.

props wonderboymusic.
fixes #29825.

Built from https://develop.svn.wordpress.org/branches/4.0@30261


git-svn-id: http://core.svn.wordpress.org/branches/4.0@30261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-11-06 08:23:29 +00:00
parent eec6b41e3d
commit 4f14d9f7f8
1 changed files with 4 additions and 4 deletions

View File

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