Make WordPress Core

Changeset 56359


Ignore:
Timestamp:
08/04/2023 11:56:16 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-includes/revision.php.

Follow-up to [24414], [38118], [38433].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/revision.php

    r56192 r56359  
    769769        }
    770770
    771         if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id
     771        if ( empty( $_REQUEST['post_format'] ) || $post->ID !== $post_id
    772772                || 'post_format' !== $taxonomy || 'revision' === $post->post_type
    773773        ) {
     
    779779        } else {
    780780                $term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' );
     781
    781782                if ( $term ) {
    782783                        $terms = array( $term ); // Can only have one post format.
     
    805806        }
    806807
    807         if ( empty( $_REQUEST['_thumbnail_id'] ) ||
    808                 empty( $_REQUEST['preview_id'] ) ||
    809                 $post->ID != $post_id ||
    810                 '_thumbnail_id' !== $meta_key ||
    811                 'revision' === $post->post_type ||
    812                 $post_id != $_REQUEST['preview_id'] ) {
    813 
     808        if ( empty( $_REQUEST['_thumbnail_id'] ) || empty( $_REQUEST['preview_id'] )
     809                || $post->ID !== $post_id || $post_id !== (int) $_REQUEST['preview_id']
     810                || '_thumbnail_id' !== $meta_key || 'revision' === $post->post_type
     811        ) {
    814812                return $value;
    815813        }
Note: See TracChangeset for help on using the changeset viewer.