Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (6 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/class-wp-http-streams.php

    r47550 r47808  
    8585                 * connect to the IPv4 address.
    8686                 */
    87                 if ( 'localhost' == strtolower( $connect_host ) ) {
     87                if ( 'localhost' === strtolower( $connect_host ) ) {
    8888                        $connect_host = '127.0.0.1';
    8989                }
     
    187187                $include_port_in_host_header = (
    188188                        ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) ||
    189                         ( 'http' == $arrURL['scheme'] && 80 != $arrURL['port'] ) ||
    190                         ( 'https' == $arrURL['scheme'] && 443 != $arrURL['port'] )
     189                        ( 'http' === $arrURL['scheme'] && 80 != $arrURL['port'] ) ||
     190                        ( 'https' === $arrURL['scheme'] && 443 != $arrURL['port'] )
    191191                );
    192192
     
    335335
    336336                // If the body was chunk encoded, then decode it.
    337                 if ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] ) && 'chunked' == $arrHeaders['headers']['transfer-encoding'] ) {
     337                if ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] )
     338                        && 'chunked' === $arrHeaders['headers']['transfer-encoding']
     339                ) {
    338340                        $process['body'] = WP_Http::chunkTransferDecode( $process['body'] );
    339341                }
     
    406408
    407409                // IP's can't be wildcards, Stop processing.
    408                 if ( 'ip' == $host_type ) {
     410                if ( 'ip' === $host_type ) {
    409411                        return false;
    410412                }
Note: See TracChangeset for help on using the changeset viewer.