Make WordPress Core

Changeset 24639


Ignore:
Timestamp:
07/10/2013 06:11:12 AM (10 years ago)
Author:
nacin
Message:

Avoid notice in XML-RPC when attaching uploads, when attachments do not have a guid in the DB. props ericmann, markoheijnen. fixes #18310.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r24623 r24639  
    43484348        if ( is_array( $attachments ) ) {
    43494349            foreach ( $attachments as $file ) {
    4350                 if ( strpos( $post_content, $file->guid ) !== false )
     4350                if ( ! empty( $file->guid ) && strpos( $post_content, $file->guid ) !== false )
    43514351                    $wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
    43524352            }
Note: See TracChangeset for help on using the changeset viewer.