WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/25/2020 07:33:22 PM (16 months 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/includes/post.php

    r47222 r47372  
    18301830        $autosave_is_different = false;
    18311831        foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {
    1832             if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
     1832            if ( normalize_whitespace( $new_autosave[ $field ] ) !== normalize_whitespace( $post->$field ) ) {
    18331833                $autosave_is_different = true;
    18341834                break;
Note: See TracChangeset for help on using the changeset viewer.