From 7d53482ceedbc5cbb8f76008b2bb8aaa6dd8801a Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 1 Aug 2013 13:33:15 +0000 Subject: [PATCH] Use wp_get_mime_types() when calling wp_check_filetype() in the audio and video shortcodes. fixes #24911. git-svn-id: http://core.svn.wordpress.org/trunk@24944 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 334e6acc87..d85f10e829 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -870,7 +870,7 @@ function wp_audio_shortcode( $attr ) { $primary = false; if ( ! empty( $src ) ) { - $type = wp_check_filetype( $src ); + $type = wp_check_filetype( $src, wp_get_mime_types() ); if ( ! in_array( $type['ext'], $default_types ) ) return sprintf( '%s', esc_url( $src ), esc_html( $src ) ); $primary = true; @@ -878,7 +878,7 @@ function wp_audio_shortcode( $attr ) { } else { foreach ( $default_types as $ext ) { if ( ! empty( $$ext ) ) { - $type = wp_check_filetype( $$ext ); + $type = wp_check_filetype( $$ext, wp_get_mime_types() ); if ( $type['ext'] === $ext ) $primary = true; } @@ -934,7 +934,7 @@ function wp_audio_shortcode( $attr ) { if ( ! empty( $$fallback ) ) { if ( empty( $fileurl ) ) $fileurl = $$fallback; - $type = wp_check_filetype( $$fallback ); + $type = wp_check_filetype( $$fallback, wp_get_mime_types() ); $html .= sprintf( $source, $type['type'], esc_url( $$fallback ) ); } } @@ -1008,7 +1008,7 @@ function wp_video_shortcode( $attr ) { $primary = false; if ( ! empty( $src ) ) { - $type = wp_check_filetype( $src ); + $type = wp_check_filetype( $src, wp_get_mime_types() ); if ( ! in_array( $type['ext'], $default_types ) ) return sprintf( '%s', esc_url( $src ), esc_html( $src ) ); $primary = true; @@ -1016,7 +1016,7 @@ function wp_video_shortcode( $attr ) { } else { foreach ( $default_types as $ext ) { if ( ! empty( $$ext ) ) { - $type = wp_check_filetype( $$ext ); + $type = wp_check_filetype( $$ext, wp_get_mime_types() ); if ( $type['ext'] === $ext ) $primary = true; } @@ -1075,7 +1075,7 @@ function wp_video_shortcode( $attr ) { if ( ! empty( $$fallback ) ) { if ( empty( $fileurl ) ) $fileurl = $$fallback; - $type = wp_check_filetype( $$fallback ); + $type = wp_check_filetype( $$fallback, wp_get_mime_types() ); // m4v sometimes shows up as video/mpeg which collides with mp4 if ( 'm4v' === $type['ext'] ) $type['type'] = 'video/m4v';