Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

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

    r47739 r47808  
    133133    }
    134134
    135     $user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
     135    $user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' === $_POST['comment_shortcuts'] ? 'true' : '';
    136136
    137137    $user->use_ssl = 0;
     
    143143
    144144    /* checking that username has been typed */
    145     if ( '' == $user->user_login ) {
     145    if ( '' === $user->user_login ) {
    146146        $errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) );
    147147    }
     
    475475
    476476    // get_user_setting() = JS-saved UI setting. Else no-js-fallback code.
    477     if ( 'hide' == get_user_setting( 'default_password_nag' ) || isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag'] ) {
     477    if ( 'hide' === get_user_setting( 'default_password_nag' )
     478        || isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag']
     479    ) {
    478480        delete_user_setting( 'default_password_nag' );
    479481        update_user_option( $user_ID, 'default_password_nag', false, true );
     
    510512    global $pagenow;
    511513    // Short-circuit it.
    512     if ( 'profile.php' == $pagenow || ! get_user_option( 'default_password_nag' ) ) {
     514    if ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) {
    513515        return;
    514516    }
Note: See TracChangeset for help on using the changeset viewer.