Make WordPress Core

Changeset 59915


Ignore:
Timestamp:
03/03/2025 08:57:07 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp_insert_comment().

Includes type casting $comment_approved to an integer to avoid breaking WP-CLI tests, since the value can be passed as a string.

Follow-up to [3104], [3193], [3887], [59903].

Props swissspidy.
See #62279.

File:
1 edited

Legend:

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

    r59903 r59915  
    20722072    $id = (int) $wpdb->insert_id;
    20732073
    2074     if ( 1 == $comment_approved ) {
     2074    if ( 1 === (int) $comment_approved ) {
    20752075        wp_update_comment_count( $comment_post_id );
    20762076
Note: See TracChangeset for help on using the changeset viewer.