mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Coding Standards: Use strict comparison for normalize_whitespace() checks when comparing revisions or autosaves.
Props dkarfa, itowhid06, TimothyBlynJacobs. Fixes #47965. git-svn-id: https://develop.svn.wordpress.org/trunk@47372 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -368,7 +368,7 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {
|
||||
$autosave_is_different = false;
|
||||
|
||||
foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {
|
||||
if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
|
||||
if ( normalize_whitespace( $new_autosave[ $field ] ) !== normalize_whitespace( $post->$field ) ) {
|
||||
$autosave_is_different = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ function wp_save_post_revision( $post_id ) {
|
||||
$post_has_changed = false;
|
||||
|
||||
foreach ( array_keys( _wp_post_revision_fields( $post ) ) as $field ) {
|
||||
if ( normalize_whitespace( $post->$field ) != normalize_whitespace( $last_revision->$field ) ) {
|
||||
if ( normalize_whitespace( $post->$field ) !== normalize_whitespace( $last_revision->$field ) ) {
|
||||
$post_has_changed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user