Make WordPress Core

Ticket #24147: 24147.patch

File 24147.patch, 1.1 KB (added by SergeyBiryukov, 12 years ago)
  • wp-includes/post-formats.php

     
    380380                                $image = is_numeric( $meta['image'] ) ? wp_get_attachment_url( $meta['image'] ) : $meta['image'];
    381381
    382382                                if ( ! empty( $image ) && ! stristr( $content, $image ) ) {
    383                                         $image_html = sprintf(
    384                                                 '<img %ssrc="%s" alt="" />',
    385                                                 empty( $compat['image_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['image_class'] ) ),
    386                                                 $image
    387                                         );
    388                                         if ( empty( $meta['url'] ) ) {
     383                                        if ( false === strpos( $image, '<a ' ) ) {
     384                                                $image_html = sprintf(
     385                                                        '<img %ssrc="%s" alt="" />',
     386                                                        empty( $compat['image_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['image_class'] ) ),
     387                                                        $image
     388                                                );
     389                                        } else {
     390                                                $image_html = $image;
     391                                        }
     392
     393                                        if ( empty( $meta['url'] ) || false !== strpos( $image, '<a ' ) ) {
    389394                                                $format_output .= $image_html;
    390395                                        } else {
    391396                                                $format_output .= sprintf(