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