X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/41578db67d72562346e4dbb2a14889b23d522813..46588ee871246a923d972538dbc93b26f4fda932:/wp-includes/ms-settings.php diff --git a/wp-includes/ms-settings.php b/wp-includes/ms-settings.php index ddcbb997..7b35e761 100644 --- a/wp-includes/ms-settings.php +++ b/wp-includes/ms-settings.php @@ -11,11 +11,12 @@ */ /** Include Multisite initialization functions */ -require( ABSPATH . WPINC . '/ms-load.php' ); -require( ABSPATH . WPINC . '/ms-default-constants.php' ); +require_once( ABSPATH . WPINC . '/ms-load.php' ); +require_once( ABSPATH . WPINC . '/ms-default-constants.php' ); -if ( defined( 'SUNRISE' ) ) +if ( defined( 'SUNRISE' ) ) { include_once( WP_CONTENT_DIR . '/sunrise.php' ); +} /** Check for and define SUBDOMAIN_INSTALL and the deprecated VHOST constant. */ ms_subdomain_constants(); @@ -35,7 +36,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) { $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 ); } - $path = strtolower( stripslashes( $_SERVER['REQUEST_URI'] ) ); + $path = stripslashes( $_SERVER['REQUEST_URI'] ); if ( is_admin() ) { $path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path ); } @@ -53,9 +54,9 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) { $current_site->blog_id = BLOGID_CURRENT_SITE; } - if ( $current_site->domain === $domain && $current_site->path === $path ) { + if ( 0 === strcasecmp( $current_site->domain, $domain ) && 0 === strcasecmp( $current_site->path, $path ) ) { $current_blog = get_site_by_path( $domain, $path ); - } elseif ( '/' !== $current_site->path && $current_site->domain === $domain && 0 === strpos( $path, $current_site->path ) ) { + } elseif ( '/' !== $current_site->path && 0 === strcasecmp( $current_site->domain, $domain ) && 0 === stripos( $path, $current_site->path ) ) { // If the current network has a path and also matches the domain and path of the request, // we need to look for a site using the first path segment following the network's path. $current_blog = get_site_by_path( $domain, $path, 1 + count( explode( '/', trim( $current_site->path, '/' ) ) ) );