Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (4 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-includes/ms-deprecated.php

    r47198 r47808  
    200200    }
    201201
    202     if ( $num == 'all' ) {
     202    if ( 'all' === $num ) {
    203203        return array_slice( $blog_list, $start, count( $blog_list ) );
    204204    } else {
     
    294294        wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
    295295    } elseif ( isset( $_GET['redirect'] ) ) {
    296         if ( substr( $_GET['redirect'], 0, 2 ) == 's_' )
     296        if ( 's_' === substr( $_GET['redirect'], 0, 2 ) )
    297297            $url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );
    298298    } elseif ( isset( $_POST['redirect'] ) ) {
     
    373373            $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
    374374            // We're not installing the main blog.
    375             if ( $blogname != 'www.' )
     375            if ( 'www.' !== $blogname )
    376376                $url .= $blogname . '/';
    377377        } else { // Main blog.
     
    719719    clean_user_cache( $user );
    720720
    721     if ( $pref == 'spam' ) {
     721    if ( 'spam' === $pref ) {
    722722        if ( $value == 1 ) {
    723723            /** This filter is documented in wp-includes/user.php */
Note: See TracChangeset for help on using the changeset viewer.