Make WordPress Core


Ignore:
Timestamp:
02/25/2020 07:33:22 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison for normalize_whitespace() checks when comparing revisions or autosaves.

Props dkarfa, itowhid06, TimothyBlynJacobs.
Fixes #47965.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php

    r47122 r47372  
    369369
    370370            foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {
    371                 if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
     371                if ( normalize_whitespace( $new_autosave[ $field ] ) !== normalize_whitespace( $post->$field ) ) {
    372372                    $autosave_is_different = true;
    373373                    break;
Note: See TracChangeset for help on using the changeset viewer.