From c907f0f4a798eecaa889e8ae5f3845064606bd67 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" 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: https://develop.svn.wordpress.org/trunk@23988 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 {