Ticket #2434: attachment-fix.diff
File attachment-fix.diff, 725 bytes (added by , 18 years ago) |
---|
-
admin-functions.php
old new 102 102 103 103 // While we have the attachment ID, let's adopt any orphans. 104 104 $attachment = & get_post($id); 105 if ( ! is_object(get_post($attachment->post_parent)) ) {105 if ( $attachment->ID && ! is_object(get_post($attachment->post_parent)) ) { 106 106 $attachment->post_parent = $post_ID; 107 107 wp_update_post($attachment); 108 108 } … … 112 112 ++$i; 113 113 } 114 114 115 $post->post_content = str_replace($post_search, $post_replace, $post->post_content);115 $post->post_content = addslashes_gpc(str_replace($post_search, $post_replace, $post->post_content)); 116 116 117 117 return wp_update_post($post); 118 118 }