From a59eb9d39c4fcba834b70c9e8dfd64feeec10ba6 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 13 May 2024 13:34:11 +0000 Subject: [PATCH] Bootstrap/Load: Update the domain parsing when initialising the cookie domain on Multisite. This ensures the cookie domain is set to the bare domain without a port number, if one is present. Props spacedmonkey Fixes #21077 Built from https://develop.svn.wordpress.org/trunk@58138 git-svn-id: http://core.svn.wordpress.org/trunk@57603 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-network.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-network.php b/wp-includes/class-wp-network.php index d33f210dab..d835765c6b 100644 --- a/wp-includes/class-wp-network.php +++ b/wp-includes/class-wp-network.php @@ -307,8 +307,8 @@ class WP_Network { if ( ! empty( $this->cookie_domain ) ) { return; } - - $this->cookie_domain = $this->domain; + $domain = parse_url( $this->domain, PHP_URL_HOST ); + $this->cookie_domain = is_string( $domain ) ? $domain : $this->domain; if ( str_starts_with( $this->cookie_domain, 'www.' ) ) { $this->cookie_domain = substr( $this->cookie_domain, 4 ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 51a04087a3..7357831199 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58137'; +$wp_version = '6.6-alpha-58138'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.