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/rewrite.php

    r47550 r47557  
    597597            $query = array();
    598598            foreach ( (array) $query_vars as $key => $value ) {
    599                 if ( in_array( $key, $wp->public_query_vars, true ) ) {
     599                if ( in_array( (string) $key, $wp->public_query_vars, true ) ) {
    600600                    $query[ $key ] = $value;
    601601                    if ( isset( $post_type_query_vars[ $key ] ) ) {
Note: See TracChangeset for help on using the changeset viewer.