From 98170817289e5ccbfe47cce46bc1069f7d79f710 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 9 May 2024 23:09:13 +0000 Subject: [PATCH] Bootstrap/Load: Take the port number into consideration when determining whether a subdomain installation of Multisite is allowed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This results in the prevention of an installation running on a port on localhost (for example `localhost:8889`) being converted to a subdomain Multisite installation, whereas previously it was incorrectly allowed. Props spacedmonkey  See #21077 Built from https://develop.svn.wordpress.org/trunk@58125 git-svn-id: http://core.svn.wordpress.org/trunk@57590 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/network.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/network.php b/wp-admin/includes/network.php index 9577172a80..fb3d8d2786 100644 --- a/wp-admin/includes/network.php +++ b/wp-admin/includes/network.php @@ -33,8 +33,9 @@ function network_domain_check() { * @return bool Whether subdomain installation is allowed */ function allow_subdomain_install() { - $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) ); - if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) { + $home = get_option( 'home' ); + $domain = parse_url( $home, PHP_URL_HOST ); + if ( parse_url( $home, PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) { return false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 31e6a28e7d..0dbfda1589 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58124'; +$wp_version = '6.6-alpha-58125'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.