Multisite: Fix case sensitivity regressions in 3.9.

Merges [28276] to the 3.9 branch.

props jeremyfelt.
fixes #27866.

Built from https://develop.svn.wordpress.org/branches/3.9@28278


git-svn-id: http://core.svn.wordpress.org/branches/3.9@28106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-05-06 05:26:14 +00:00
parent dfb0e1aaa8
commit d6656c58e0
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
$_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 ); $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 );
} }
$path = strtolower( stripslashes( $_SERVER['REQUEST_URI'] ) ); $path = stripslashes( $_SERVER['REQUEST_URI'] );
if ( is_admin() ) { if ( is_admin() ) {
$path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path ); $path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path );
} }
@ -53,9 +53,9 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
$current_site->blog_id = BLOGID_CURRENT_SITE; $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 ); $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, // 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. // 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, '/' ) ) ) ); $current_blog = get_site_by_path( $domain, $path, 1 + count( explode( '/', trim( $current_site->path, '/' ) ) ) );