From e3eda04c70ea51aa3c6969d9f167d5639846ef13 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Mon, 22 Apr 2013 21:01:03 +0000 Subject: [PATCH] Fix some mangled HTML in image format posts compat. props SergeyBiryukov. fixes #24147. git-svn-id: https://develop.svn.wordpress.org/trunk@24062 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-formats.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index 0d80a3833a..5bec3aac44 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -380,12 +380,17 @@ function post_formats_compat( $content, $id = 0 ) { $image = is_numeric( $meta['image'] ) ? wp_get_attachment_url( $meta['image'] ) : $meta['image']; if ( ! empty( $image ) && ! stristr( $content, $image ) ) { - $image_html = sprintf( - '', - empty( $compat['image_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['image_class'] ) ), - $image - ); - if ( empty( $meta['url'] ) ) { + if ( false === strpos( $image, '', + empty( $compat['image_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['image_class'] ) ), + $image + ); + } else { + $image_html = $image; + } + + if ( empty( $meta['url'] ) || false !== strpos( $image, '