Make WordPress Core

Changeset 38658


Ignore:
Timestamp:
09/27/2016 05:56:53 PM (8 years ago)
Author:
jeremyfelt
Message:

Multisite: Handle get_id_from_blogname() lookups when the network domain has www..

Previously, if a network's domain started with www. in a subdomain configuration, a slug lookup with get_id_from_blogname() would not match an existing site. A similar lookup in a subdirectory configuration would work fine.

This strips www. from the network's domain in a subdomain configuration during the lookup and returns the site as expected.

Adds tests which would previously fail in a subdomain configuration, but now pass in both configurations.

Props igmoweb, flixos90.
Fixes #34450.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-blogs.php

    r38636 r38658  
    9393
    9494    if ( is_subdomain_install() ) {
    95         $domain = $slug . '.' . $current_site->domain;
     95        $domain = $slug . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
    9696        $path = $current_site->path;
    9797    } else {
Note: See TracChangeset for help on using the changeset viewer.