From a8d12183f23694718756c9e84338e12342b2fcb9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 12 Jul 2023 09:44:30 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `wp-includes/class-wp-network.php`. Follow-up to [41380], [41861], [45910]. Props aristath, poena, afercia, SergeyBiryukov. See #57839. git-svn-id: https://develop.svn.wordpress.org/trunk@56219 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-network.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-network.php b/src/wp-includes/class-wp-network.php index b1d46b7ce0..d33f210dab 100644 --- a/src/wp-includes/class-wp-network.php +++ b/src/wp-includes/class-wp-network.php @@ -228,6 +228,7 @@ class WP_Network { * @param WP_Network $network The network object for which the main site was detected. */ $main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this ); + if ( 0 < $main_site_id ) { return $main_site_id; } @@ -236,8 +237,10 @@ class WP_Network { return (int) $this->blog_id; } - if ( ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) && DOMAIN_CURRENT_SITE === $this->domain && PATH_CURRENT_SITE === $this->path ) - || ( defined( 'SITE_ID_CURRENT_SITE' ) && SITE_ID_CURRENT_SITE == $this->id ) ) { + if ( ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) + && DOMAIN_CURRENT_SITE === $this->domain && PATH_CURRENT_SITE === $this->path ) + || ( defined( 'SITE_ID_CURRENT_SITE' ) && (int) SITE_ID_CURRENT_SITE === $this->id ) + ) { if ( defined( 'BLOG_ID_CURRENT_SITE' ) ) { $this->blog_id = (string) BLOG_ID_CURRENT_SITE;