Make WordPress Core

Ticket #25416: 25416.diff

File 25416.diff, 713 bytes (added by kovshenin, 11 years ago)
  • src/wp-admin/includes/post.php

     
    13631363                // If the new autosave has the same content as the post, delete the autosave.
    13641364                $post = get_post( $post_id );
    13651365                $autosave_is_different = false;
    1366                 foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
     1366                foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields() ) ) as $field ) {
    13671367                        if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
    13681368                                $autosave_is_different = true;
    13691369                                break;