mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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. Built from https://develop.svn.wordpress.org/trunk@38658 git-svn-id: http://core.svn.wordpress.org/trunk@38601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3d19ab1ce2
commit
7fe5b6d182
@ -92,7 +92,7 @@ function get_id_from_blogname( $slug ) {
|
|||||||
return $blog_id;
|
return $blog_id;
|
||||||
|
|
||||||
if ( is_subdomain_install() ) {
|
if ( is_subdomain_install() ) {
|
||||||
$domain = $slug . '.' . $current_site->domain;
|
$domain = $slug . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
|
||||||
$path = $current_site->path;
|
$path = $current_site->path;
|
||||||
} else {
|
} else {
|
||||||
$domain = $current_site->domain;
|
$domain = $current_site->domain;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-alpha-38657';
|
$wp_version = '4.7-alpha-38658';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user