Make WordPress Core


Ignore:
Timestamp:
04/09/2020 03:41:04 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict type check for in_array() and array_search().

This addresses all the remaining WordPress.PHP.StrictInArray.MissingTrueStrict issues in core.

Includes minor code layout fixes for better readability.

Follow-up to [47550].

See #49542.

File:
1 edited

Legend:

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

    r47219 r47557  
    239239                return new WP_Error( 'http_request_failed', $curl_error );
    240240            }
    241             if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {
     241            if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) {
    242242                curl_close( $handle );
    243243                return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
     
    287287                }
    288288            }
    289             if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {
     289            if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) {
    290290                curl_close( $handle );
    291291                return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
Note: See TracChangeset for help on using the changeset viewer.