Ticket #49156: 49156.patch
File 49156.patch, 1.3 KB (added by , 4 years ago) |
---|
-
class-wp-rest-autosaves-controller.php
212 212 $prepared_post->ID = $post->ID; 213 213 $user_id = get_current_user_id(); 214 214 215 if ( ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status ) && $post->post_author == $user_id ) {215 if ( ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status ) && $post->post_author === $user_id ) { 216 216 // Draft posts for the same author: autosaving updates the post and does not create a revision. 217 217 // Convert the post object to an array and add slashes, wp_update_post expects escaped array. 218 218 $autosave_id = wp_update_post( wp_slash( (array) $prepared_post ), true ); … … 349 349 $autosave_is_different = false; 350 350 351 351 foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) { 352 if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {352 if ( normalize_whitespace( $new_autosave[ $field ] ) !== normalize_whitespace( $post->$field ) ) { 353 353 $autosave_is_different = true; 354 354 break; 355 355 }