Skip to content

Commit 9032503

Browse files
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], [https://mu.trac.wordpress.org/changeset/550 mu:550], [https://mu.trac.wordpress.org/changeset/1958 mu:1958], [12603]. Props justlevine. See #63268. git-svn-id: https://develop.svn.wordpress.org/trunk@60450 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0fd771a commit 9032503

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/ms-functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
730730
* unless it's the user's own username.
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
}
736736
}

0 commit comments

Comments
 (0)