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-admin/edit-form-advanced.php

    r47222 r47372  
    246246if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
    247247    foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
    248         if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
     248        if ( normalize_whitespace( $autosave->$autosave_field ) !== normalize_whitespace( $post->$autosave_field ) ) {
    249249            $notice = sprintf(
    250250                /* translators: %s: URL to view the autosave. */
Note: See TracChangeset for help on using the changeset viewer.