Make WordPress Core

Changeset 59561


Ignore:
Timestamp:
12/25/2024 06:29:51 PM (23 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in remove_user_from_blog().

Follow-up to ​mu:543.

Props debarghyabanerjee, aristath, poena, afercia, SergeyBiryukov.
See #62279, #62283.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r59560 r59561  
    231231        global $wpdb;
    232232
     233        $user_id = (int) $user_id;
     234        $blog_id = (int) $blog_id;
     235
    233236        switch_to_blog( $blog_id );
    234         $user_id = (int) $user_id;
    235237
    236238        /**
    … …  
    250252         * if the user is assigned to multiple blogs.
    251253         */
    252         $primary_blog = get_user_meta( $user_id, 'primary_blog', true );
    253         if ( $primary_blog == $blog_id ) {
     254        $primary_blog = (int) get_user_meta( $user_id, 'primary_blog', true );
     255        if ( $primary_blog === $blog_id ) {
    254256                $new_id     = '';
    255257                $new_domain = '';
    256258                $blogs      = get_blogs_of_user( $user_id );
    257259                foreach ( (array) $blogs as $blog ) {
    258                         if ( $blog->userblog_id == $blog_id ) {
     260                        if ( $blog->userblog_id === $blog_id ) {
    259261                                continue;
    260262                        }
Note: See TracChangeset for help on using the changeset viewer.