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/link-template.php

    r47550 r47557  
    36883688
    36893689    $blogs = get_blogs_of_user( $user_id );
     3690
    36903691    if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty( $blogs ) ) {
    36913692        $url = user_admin_url( $path, $scheme );
     
    36943695    } else {
    36953696        $current_blog = get_current_blog_id();
    3696         if ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ) ) ) ) {
     3697
     3698        if ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ), true ) ) ) {
    36973699            $url = admin_url( $path, $scheme );
    36983700        } else {
Note: See TracChangeset for help on using the changeset viewer.