Make WordPress Core


Ignore:
Timestamp:
04/09/2020 03:41:04 PM (4 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-admin/includes/plugin.php

    r47550 r47557  
    21712171                $whitelist_options[ $page ][] = $key;
    21722172            } else {
    2173                 $pos = array_search( $key, $whitelist_options[ $page ] );
     2173                $pos = array_search( $key, $whitelist_options[ $page ], true );
    21742174                if ( false === $pos ) {
    21752175                    $whitelist_options[ $page ][] = $key;
     
    22032203        foreach ( $keys as $key ) {
    22042204            if ( isset( $whitelist_options[ $page ] ) && is_array( $whitelist_options[ $page ] ) ) {
    2205                 $pos = array_search( $key, $whitelist_options[ $page ] );
     2205                $pos = array_search( $key, $whitelist_options[ $page ], true );
    22062206                if ( false !== $pos ) {
    22072207                    unset( $whitelist_options[ $page ][ $pos ] );
Note: See TracChangeset for help on using the changeset viewer.