Make WordPress Core

Changeset 57882


Ignore:
Timestamp:
03/26/2024 09:39:36 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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

Follow-up to [3566], [6387], [10437], [11057], [11387], [16208], [16304], [18195], [20410], [26367], [34947].

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

File:
1 edited

Legend:

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

    r57693 r57882  
    3131                if ( isset( $current_user )
    3232                && ( $current_user instanceof WP_User )
    33                 && ( $id == $current_user->ID )
     33                && ( $id === $current_user->ID )
    3434                && ( null !== $id )
    3535                ) {
     
    618618                $user = apply_filters( 'authenticate', null, $username, $password );
    619619
    620                 if ( null == $user ) {
     620                if ( null === $user ) {
    621621                        /*
    622622                         * TODO: What should the error message be? (Or would these even happen?)
     
    10941094                setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
    10951095                setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
    1096                 if ( COOKIEPATH != SITECOOKIEPATH ) {
     1096                if ( COOKIEPATH !== SITECOOKIEPATH ) {
    10971097                        setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
    10981098                }
     
    13161316         */
    13171317        function check_ajax_referer( $action = -1, $query_arg = false, $stop = true ) {
    1318                 if ( -1 == $action ) {
     1318                if ( -1 === $action ) {
    13191319                        _doing_it_wrong( __FUNCTION__, __( 'You should specify an action to be verified by using the first parameter.' ), '4.7.0' );
    13201320                }
     
    16991699
    17001700                // The comment was left by the author.
    1701                 if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {
     1701                if ( $author && ! $notify_author && (int) $comment->user_id === (int) $post->post_author ) {
    17021702                        unset( $emails[ $author->user_email ] );
    17031703                }
    17041704
    17051705                // The author moderated a comment on their own post.
    1706                 if ( $author && ! $notify_author && get_current_user_id() == $post->post_author ) {
     1706                if ( $author && ! $notify_author && get_current_user_id() === (int) $post->post_author ) {
    17071707                        unset( $emails[ $author->user_email ] );
    17081708                }
Note: See TracChangeset for help on using the changeset viewer.