Make WordPress Core

Changeset 58125

Timestamp:
05/09/2024 11:07:51 PM (3 months ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/network.php

    r58097 r58125  
    3434 */
    3535function allow_subdomain_install() {
    36     $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
    37     if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) {
     36    $home   = get_option( 'home' );
     37    $domain = parse_url( $home, PHP_URL_HOST );
     38    if ( parse_url( $home, PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) {
    3839        return false;
    3940    }
Note: See TracChangeset for help on using the changeset viewer.