Make WordPress Core

Changeset 24062


Ignore:
Timestamp:
04/22/2013 09:01:03 PM (13 years ago)
Author:
markjaquith
Message:

Fix some mangled HTML in image format posts compat.

props SergeyBiryukov. fixes #24147.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-formats.php

    r24057 r24062  
    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 {
Note: See TracChangeset for help on using the changeset viewer.