Multisite: Ensure that get_blogaddress_by_name does not mangle blognames with leading digits.

Correctly specify the backreference in the regular expression so that it can not become ambiguous when there is a leading digit on the blogname.

Fixes #23689 props dllh.


git-svn-id: https://develop.svn.wordpress.org/trunk@23686 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2013-03-13 16:00:38 +00:00
parent 6c937208e7
commit 7e33770010

View File

@ -48,7 +48,7 @@ function get_blogaddress_by_name( $blogname ) {
$blogname = 'www';
$url = rtrim( network_home_url(), '/' );
if ( !empty( $blogname ) )
$url = preg_replace( '|^([^\.]+://)|', '$1' . $blogname . '.', $url );
$url = preg_replace( '|^([^\.]+://)|', "\${1}" . $blogname . '.', $url );
} else {
$url = network_home_url( $blogname );
}