From f7155059348a988b0c3667f8d1534bea860889fd Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Sun, 14 Apr 2013 10:33:44 +0000 Subject: [PATCH] Don't print links for unsupported file types in wp_video_shortcode()/wp_audio_shortcode(). Return them instead. props SergeyBiryukov. fixes #24075. git-svn-id: http://core.svn.wordpress.org/trunk@23988 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 745ed4768e..aa52352055 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -860,10 +860,8 @@ function wp_audio_shortcode( $attr ) { $primary = false; if ( ! empty( $src ) ) { $type = wp_check_filetype( $src ); - if ( ! in_array( $type['ext'], $default_types ) ) { - printf( '%1$s', $src ); - return; - } + if ( ! in_array( $type['ext'], $default_types ) ) + return sprintf( '%1$s', $src ); $primary = true; array_unshift( $default_types, 'src' ); } else { @@ -967,10 +965,8 @@ function wp_video_shortcode( $attr ) { $primary = false; if ( ! empty( $src ) ) { $type = wp_check_filetype( $src ); - if ( ! in_array( $type['ext'], $default_types ) ) { - printf( '%1$s', $src ); - return; - } + if ( ! in_array( $type['ext'], $default_types ) ) + return sprintf( '%1$s', $src ); $primary = true; array_unshift( $default_types, 'src' ); } else {