From e04c8d972e14f28664e1e9a8fa5ab211b0e0cb45 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 19 Oct 2006 00:37:10 +0000 Subject: [PATCH] Attachment link fixes from mdawaffe. fixes #3261 git-svn-id: http://svn.automattic.com/wordpress/trunk@4408 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 12 ++++++------ wp-admin/upload-js.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index d416183f20..0b2ed2ccab 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -122,12 +122,12 @@ function fix_attachment_links($post_ID) { return; $i = 0; - $search = "# id=(\"|')p(\d+)\\1#i"; + $search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i"; foreach ( $anchor_matches[0] as $anchor ) { if ( 0 == preg_match($search, $anchor, $id_matches) ) continue; - $id = $id_matches[2]; + $id = $id_matches[3]; // While we have the attachment ID, let's adopt any orphans. $attachment = & get_post($id, ARRAY_A); @@ -2007,11 +2007,11 @@ function the_attachment_links($id = false) { - + - + @@ -2020,7 +2020,7 @@ function the_attachment_links($id = false) { - + @@ -2120,4 +2120,4 @@ function wp_load_image($file) { return $image; } -?> \ No newline at end of file +?> diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index 5c760b70e6..bab889e811 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -221,7 +221,7 @@ addLoadEvent( function() { display = 'full'; if ( 'none' != link ) - h += ""; + h += ""; if ( display ) h += "" + this.currentImage.title + ""; else