Bootstrap/Load: Take the port number into consideration when determining whether a subdomain installation of Multisite is allowed.

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
This commit is contained in:
John Blackbourn 2024-05-09 23:09:13 +00:00
parent 1a20e9cc6a
commit 9817081728
2 changed files with 4 additions and 3 deletions

View File

@ -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;
}

View File

@ -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.