Changeset 27063 for trunk/src/wp-includes/media.php
- Timestamp:
- 01/31/2014 06:58:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r27051 r27063 1148 1148 $width = $w; 1149 1149 1150 $yt_pattern = '#^https?://(:?www\.)?(:?youtube\.com/watch|youtu\.be/)#'; 1151 1150 1152 $primary = false; 1151 1153 if ( ! empty( $src ) ) { 1152 $type = wp_check_filetype( $src, wp_get_mime_types() ); 1153 if ( ! in_array( strtolower( $type['ext'] ), $default_types ) ) 1154 return sprintf( '<a class="wp-embedded-video" href="%s">%s</a>', esc_url( $src ), esc_html( $src ) ); 1154 if ( ! preg_match( $yt_pattern, $src ) ) { 1155 $type = wp_check_filetype( $src, wp_get_mime_types() ); 1156 if ( ! in_array( strtolower( $type['ext'] ), $default_types ) ) { 1157 return sprintf( '<a class="wp-embedded-video" href="%s">%s</a>', esc_url( $src ), esc_html( $src ) ); 1158 } 1159 } 1155 1160 $primary = true; 1156 1161 array_unshift( $default_types, 'src' ); … … 1217 1222 if ( empty( $fileurl ) ) 1218 1223 $fileurl = $$fallback; 1219 $type = wp_check_filetype( $$fallback, wp_get_mime_types() ); 1220 // m4v sometimes shows up as video/mpeg which collides with mp4 1221 if ( 'm4v' === $type['ext'] ) 1222 $type['type'] = 'video/m4v'; 1224 1225 if ( 'src' === $fallback && preg_match( $yt_pattern, $src ) ) { 1226 $type = array( 'type' => 'video/youtube' ); 1227 } else { 1228 $type = wp_check_filetype( $$fallback, wp_get_mime_types() ); 1229 // m4v sometimes shows up as video/mpeg which collides with mp4 1230 if ( 'm4v' === $type['ext'] ) 1231 $type['type'] = 'video/m4v'; 1232 } 1223 1233 $html .= sprintf( $source, $type['type'], esc_url( $$fallback ) ); 1224 1234 }
Note: See TracChangeset
for help on using the changeset viewer.