Make WordPress Core

Changeset 60450

Timestamp:
07/13/2025 03:20:49 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Replace redundant check in wpmu_validate_blog_signup().

The is_object() check would always be true in the second part of the conditional. This commit adds an instanceof WP_User check instead before accessing the user_login property.

Follow-up to [41963], mu:550, mu:1958, [12603].

Props justlevine.
See #63268.

File:
1 edited

Legend:

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

    r60178 r60450  
    731731     */
    732732    if ( username_exists( $blogname ) ) {
    733         if ( ! is_object( $user ) || ( is_object( $user ) && $user->user_login !== $blogname ) ) {
     733        if ( ! $user instanceof WP_User || $user->user_login !== $blogname ) {
    734734            $errors->add( 'blogname', __( 'Sorry, that site is reserved!' ) );
    735735        }
Note: See TracChangeset for help on using the changeset viewer.