Make WordPress Core

Changeset 23988


Ignore:
Timestamp:
04/14/2013 10:33:44 AM (12 years ago)
Author:
ocean90
Message:

Don't print links for unsupported file types in wp_video_shortcode()/wp_audio_shortcode(). Return them instead.

props SergeyBiryukov. fixes #24075.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r23984 r23988  
    861861    if ( ! empty( $src ) ) {
    862862        $type = wp_check_filetype( $src );
    863         if ( ! in_array( $type['ext'], $default_types ) ) {
    864             printf( '<a class="wp-post-format-link-audio" href="%1$s">%1$s</a>', $src );
    865             return;
    866         }
     863        if ( ! in_array( $type['ext'], $default_types ) )
     864            return sprintf( '<a class="wp-post-format-link-audio" href="%1$s">%1$s</a>', $src );
    867865        $primary = true;
    868866        array_unshift( $default_types, 'src' );
     
    968966    if ( ! empty( $src ) ) {
    969967        $type = wp_check_filetype( $src );
    970         if ( ! in_array( $type['ext'], $default_types ) ) {
    971             printf( '<a class="wp-post-format-link-video" href="%1$s">%1$s</a>', $src );
    972             return;
    973         }
     968        if ( ! in_array( $type['ext'], $default_types ) )
     969            return sprintf( '<a class="wp-post-format-link-video" href="%1$s">%1$s</a>', $src );
    974970        $primary = true;
    975971        array_unshift( $default_types, 'src' );
Note: See TracChangeset for help on using the changeset viewer.