From 045f93f3b2c32bd1a0a03e44b84e4eaf33ba9b9e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 26 Aug 2013 19:21:10 +0000 Subject: [PATCH] Ignore case differences when checking file extension in wp_audio_shortcode() and wp_video_shortcode(). props nofearinc, bhengh. fixes #25140. Built from https://develop.svn.wordpress.org/trunk@25128 git-svn-id: http://core.svn.wordpress.org/trunk@25108 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 6111f36370..8a41c79d2c 100644 --- a/wp-includes/media.php +++ b/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; } }