Make WordPress Core


Ignore:
Timestamp:
08/29/2019 02:09:42 AM (7 years ago)
Author:
SergeyBiryukov
Message:

XML-RPC: Make sure editing a draft post with wp.editPost does not unintentionally cause its published date to be set.

Props redsweater.
Fixes #45322.

File:
1 edited

Legend:

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

    r45823 r45906  
    17091709                }
    17101710
     1711                /*
     1712                 * If the API client did not provide post_date, then we must not perpetuate the value that was
     1713                 * stored in the database, or it will appear to be an intentional edit. Conveying it here as if
     1714                 * it was coming from the API client will cause an otherwise zeroed out post_date_gmt to get set
     1715                 * with the value that was originally stored in the database when the draft was created.
     1716                 */
     1717                if ( ! isset( $content_struct['post_date'] ) ) {
     1718                        unset( $post['post_date'] );
     1719                }
     1720
    17111721                $this->escape( $post );
    17121722                $merged_content_struct = array_merge( $post, $content_struct );
Note: See TracChangeset for help on using the changeset viewer.