From 6d050b262f123b704f1433a787d2ed32e1742e6b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 26 Aug 2013 19:20:36 +0000 Subject: [PATCH] Ignore case differences when checking file extension in wp_audio_shortcode() and wp_video_shortcode(). props nofearinc, bhengh. fixes #25140. git-svn-id: https://develop.svn.wordpress.org/trunk@25128 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 6111f36370..8a41c79d2c 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -871,7 +871,7 @@ function wp_audio_shortcode( $attr ) { $primary = false; if ( ! empty( $src ) ) { $type = wp_check_filetype( $src, wp_get_mime_types() ); - if ( ! in_array( $type['ext'], $default_types ) ) + if ( ! in_array( strtolower( $type['ext'] ), $default_types ) ) return sprintf( '%s', esc_url( $src ), esc_html( $src ) ); $primary = true; array_unshift( $default_types, 'src' ); @@ -879,7 +879,7 @@ function wp_audio_shortcode( $attr ) { foreach ( $default_types as $ext ) { if ( ! empty( $$ext ) ) { $type = wp_check_filetype( $$ext, wp_get_mime_types() ); - if ( $type['ext'] === $ext ) + if ( strtolower( $type['ext'] ) === $ext ) $primary = true; } } @@ -1010,7 +1010,7 @@ function wp_video_shortcode( $attr ) { $primary = false; if ( ! empty( $src ) ) { $type = wp_check_filetype( $src, wp_get_mime_types() ); - if ( ! in_array( $type['ext'], $default_types ) ) + if ( ! in_array( strtolower( $type['ext'] ), $default_types ) ) return sprintf( '%s', esc_url( $src ), esc_html( $src ) ); $primary = true; array_unshift( $default_types, 'src' ); @@ -1018,7 +1018,7 @@ function wp_video_shortcode( $attr ) { foreach ( $default_types as $ext ) { if ( ! empty( $$ext ) ) { $type = wp_check_filetype( $$ext, wp_get_mime_types() ); - if ( $type['ext'] === $ext ) + if ( strtolower( $type['ext'] ) === $ext ) $primary = true; } }