Make WordPress Core


Ignore:
Timestamp:
01/09/2020 12:53:29 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison and Yoda conditions in the root directory files.

Props pikamander2.
Fixes #48965.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-activate.php

    r45932 r47054  
    3838    $redirect_url = remove_query_arg( 'key' );
    3939
    40     if ( $redirect_url !== remove_query_arg( false ) ) {
     40    if ( remove_query_arg( false ) !== $redirect_url ) {
    4141        setcookie( $activate_cookie, $key, 0, $activate_path, COOKIE_DOMAIN, is_ssl(), true );
    4242        wp_safe_redirect( $redirect_url );
     
    4747}
    4848
    49 if ( $result === null && isset( $_COOKIE[ $activate_cookie ] ) ) {
     49if ( null === $result && isset( $_COOKIE[ $activate_cookie ] ) ) {
    5050    $key    = $_COOKIE[ $activate_cookie ];
    5151    $result = wpmu_activate_signup( $key );
     
    5353}
    5454
    55 if ( $result === null || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {
     55if ( null === $result || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {
    5656    status_header( 404 );
    5757} elseif ( is_wp_error( $result ) ) {
     
    143143            <?php
    144144            echo '<p class="lead-in">';
    145             if ( $signup->domain . $signup->path == '' ) {
     145            if ( '' === $signup->domain . $signup->path ) {
    146146                printf(
    147147                    /* translators: 1: Login URL, 2: Username, 3: User email address, 4: Lost password URL. */
     
    163163            }
    164164            echo '</p>';
    165         } elseif ( $result === null || is_wp_error( $result ) ) {
     165        } elseif ( null === $result || is_wp_error( $result ) ) {
    166166            ?>
    167167            <h2><?php _e( 'An error occurred during the activation' ); ?></h2>
     
    182182
    183183            <?php
    184             if ( $url && $url != network_home_url( '', 'http' ) ) :
     184            if ( $url && network_home_url( '', 'http' ) !== $url ) :
    185185                switch_to_blog( (int) $result['blog_id'] );
    186186                $login_url = wp_login_url();
Note: See TracChangeset for help on using the changeset viewer.