Make WordPress Core

Changeset 55592


Ignore:
Timestamp:
03/25/2023 03:23:41 PM (18 months ago)
Author:
SergeyBiryukov
Message:

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

Follow-up to [10990], [11162], [11217], [37059].

Props jenilk.
Fixes #57317.

File:
1 edited

Legend:

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

    r55283 r55592  
    180180
    181181    // Checking the password has been typed twice the same.
    182     if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {
     182    if ( ( $update || ! empty( $pass1 ) ) && $pass1 !== $pass2 ) {
    183183        $errors->add( 'pass', __( '<strong>Error:</strong> Passwords do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
    184184    }
     
    203203    }
    204204
    205     /* checking email address */
     205    // Checking email address.
    206206    if ( empty( $user->user_email ) ) {
    207207        $errors->add( 'empty_email', __( '<strong>Error:</strong> Please enter an email address.' ), array( 'form-field' => 'email' ) );
     
    210210    } else {
    211211        $owner_id = email_exists( $user->user_email );
    212         if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {
     212        if ( $owner_id && ( ! $update || ( $owner_id !== $user->ID ) ) ) {
    213213            $errors->add( 'email_exists', __( '<strong>Error:</strong> This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );
    214214        }
     
    486486    // get_user_setting() = JS-saved UI setting. Else no-js-fallback code.
    487487    if ( 'hide' === get_user_setting( 'default_password_nag' )
    488         || isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag']
     488        || isset( $_GET['default_password_nag'] ) && '0' === $_GET['default_password_nag']
    489489    ) {
    490490        delete_user_setting( 'default_password_nag' );
     
    508508
    509509    // Remove the nag if the password has been changed.
    510     if ( $new_data->user_pass != $old_data->user_pass ) {
     510    if ( $new_data->user_pass !== $old_data->user_pass ) {
    511511        delete_user_setting( 'default_password_nag' );
    512512        update_user_meta( $user_ID, 'default_password_nag', false );
Note: See TracChangeset for help on using the changeset viewer.