Make WordPress Core

Ticket #18310: 18310-3.diff

File 18310-3.diff, 1.2 KB (added by markoheijnen, 10 years ago)

No isset but empty check. Also change arrray to array

  • wp-includes/post.php

     
    39823982                $wpdb->update( $wpdb->posts, compact("post_name"), array( 'ID' => $post_ID ) );
    39833983        }
    39843984
     3985        if ( empty( $guid ) )
     3986                $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), array( 'ID' => $post_ID ) );
     3987
    39853988        if ( is_object_in_taxonomy($post_type, 'category') )
    39863989                wp_set_post_categories( $post_ID, $post_category );
    39873990
  • wp-includes/class-wp-xmlrpc-server.php

     
    43384338                $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" );
    43394339                if ( is_array( $attachments ) ) {
    43404340                        foreach ( $attachments as $file ) {
    4341                                 if ( strpos( $post_content, $file->guid ) !== false )
     4341                                if ( isset( $file->guid ) && strpos( $post_content, $file->guid ) !== false )
    43424342                                        $wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
    43434343                        }
    43444344                }