WordPress.org

Make WordPress Core

Changeset 27690


Ignore:
Timestamp:
03/24/2014 08:31:51 PM (6 years ago)
Author:
wonderboymusic
Message:

In wp_create_post_autosave(), intersect the $new_autosave's keys with the keys from _wp_post_revision_fields() to ensure that all expected fields are present.

Props kovshenin.
Fixes #25416.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r27667 r27690  
    14691469        $post = get_post( $post_id );
    14701470        $autosave_is_different = false;
    1471         foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
     1471        foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields() ) ) as $field ) {
    14721472            if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
    14731473                $autosave_is_different = true;
Note: See TracChangeset for help on using the changeset viewer.