From 9fb13d2cbab06feafc2db6f906c52672a8b9cccc Mon Sep 17 00:00:00 2001 From: wpmuguru Date: Sun, 16 May 2010 22:21:06 +0000 Subject: [PATCH] use network_home_url in get_blogaddress_by_name, see #12735 git-svn-id: http://svn.automattic.com/wordpress/trunk@14703 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-blogs.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 4254467378..a6f2f2de1d 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -29,10 +29,13 @@ function get_blogaddress_by_name( $blogname ) { if ( is_subdomain_install() ) { if ( $blogname == 'main' ) $blogname = 'www'; - return esc_url( 'http://' . $blogname . '.' . $current_site->domain . $current_site->path ); + $url = rtrim( network_home_url(), '/' ); + if ( !empty( $blogname ) ) + $url = preg_replace( '|^([^\.]+://)|', '$1' . $blogname . '.', $url ); } else { - return esc_url( 'http://' . $current_site->domain . $current_site->path . $blogname . '/' ); + $url = network_home_url( $blogname ); } + return esc_url( $url . '/' ); } function get_blogaddress_by_domain( $domain, $path ){