Ticket #18310: 18310-2.diff
File 18310-2.diff, 1.2 KB (added by , 11 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
3953 3953 $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" ); 3954 3954 if ( is_array( $attachments ) ) { 3955 3955 foreach ( $attachments as $file ) { 3956 if ( strpos( $post_content, $file->guid ) !== false )3956 if ( isset( $file->guid ) && strpos( $post_content, $file->guid ) !== false ) 3957 3957 $wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) ); 3958 3958 } 3959 3959 } -
wp-includes/post.php
3784 3784 $wpdb->update( $wpdb->posts, compact("post_name"), array( 'ID' => $post_ID ) ); 3785 3785 } 3786 3786 3787 // Set GUID 3788 if ( ! isset( $guid ) ) 3789 $wpdb->update ( $wpdb->posts, arrray( 'guid' => get_permalink( $post_ID ) ), array( 'ID' => $post_ID ) ); 3790 3787 3791 wp_set_post_categories($post_ID, $post_category); 3788 3792 3789 3793 if ( $file )