Changes between Initial Version and Version 1 of Ticket #13429, comment 43
- Timestamp:
- 03/08/2012 01:36:06 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #13429, comment 43
initial v1 4 4 I don't think the place to fix this bug is in media.php, unless it's to stop the rel="attachment" attribute getting added in the first place, and I can't see an obvious way to decide when and when not to add that attribute. 5 5 6 So theother way to attack it is via the _fix_attachment_links( ) function in /wp-admin/includes/post.php.6 Another way to attack it is via the _fix_attachment_links( ) function in /wp-admin/includes/post.php. 7 7 8 '''Here's the clue''': If you revert this function to the one in wordpress 2.8 release the correct behaviour returns. 9 10 The change that triggers the error looks like it's the addition of the preg_replace_callback 8 The trigger for the error looks like it's the preg_replace_callback 11 9 {{{ 12 10 $_fix_attachment_link_id = $id; … … 16 14 If I follow this correctly it's completely rewriting the href attribute by calling into get_attachment_link() in the callback function. 17 15 So any link with rel="attachment" and a parsable ID in that rel anywhere in the post content will get destroyed by this every time a post is saved. 16 17 Perhaps the solution is to check the url more closely to see if it is in fact a link to an attachment before doing the callback??