From a5298798aa08dd157c23c7e7f41ff580004b94b0 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 19 Oct 2006 00:37:10 +0000 Subject: [PATCH] Attachment link fixes from mdawaffe. fixes #3261 git-svn-id: https://develop.svn.wordpress.org/trunk@4408 602fd350-edb4-49c9-b593-d223f7449a82 --- 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