From 6740a74398c0c87f37a1498b3f348d79743d3bce Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 29 Mar 2010 09:57:34 +0000 Subject: [PATCH] Do not add rel="attachment" for direct(File URL, not Post URL) links to non-media files in "Insert into Post". Fixes #7040 git-svn-id: https://develop.svn.wordpress.org/trunk@13875 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 52c0782c6d..f2094b8b51 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -462,8 +462,8 @@ function media_upload_form_handler() { $html = $attachment['post_title']; if ( !empty($attachment['url']) ) { $rel = ''; - if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) ) - $rel = " rel='attachment wp-att-" . esc_attr($send_id)."'"; + if ( strpos($attachment['url'], 'attachment_id') || get_attachment_link($send_id) == $attachment['url'] ) + $rel = " rel='attachment wp-att-" . esc_attr($send_id) . "'"; $html = "$html"; }