Make WordPress Core


Ignore:
Timestamp:
06/07/2023 06:38:10 AM (19 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-includes/class-wp-http-streams.php.

Follow-up to [12424], [25224], [25303], [29852], [45667], [47808], [51825].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-http-streams.php

    r55063 r55886  
    127127        );
    128128
    129         $timeout         = (int) floor( $parsed_args['timeout'] );
    130         $utimeout        = $timeout == $parsed_args['timeout'] ? 0 : 1000000 * $parsed_args['timeout'] % 1000000;
     129        $timeout  = (int) floor( $parsed_args['timeout'] );
     130        $utimeout = 0;
     131
     132        if ( $timeout !== (int) $parsed_args['timeout'] ) {
     133            $utimeout = 1000000 * $parsed_args['timeout'] % 1000000;
     134        }
     135
    131136        $connect_timeout = max( $timeout, 1 );
    132137
     
    218223        $include_port_in_host_header = (
    219224            ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
    220             || ( 'http' === $parsed_url['scheme'] && 80 != $parsed_url['port'] )
    221             || ( 'https' === $parsed_url['scheme'] && 443 != $parsed_url['port'] )
     225            || ( 'http' === $parsed_url['scheme'] && 80 !== $parsed_url['port'] )
     226            || ( 'https' === $parsed_url['scheme'] && 443 !== $parsed_url['port'] )
    222227        );
    223228
     
    321326                $bytes_written_to_file = fwrite( $stream_handle, $block );
    322327
    323                 if ( $bytes_written_to_file != $this_block_size ) {
     328                if ( $bytes_written_to_file !== $this_block_size ) {
    324329                    fclose( $handle );
    325330                    fclose( $stream_handle );
Note: See TracChangeset for help on using the changeset viewer.