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: http://core.svn.wordpress.org/trunk@23686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
072cccd0e4
commit
ffe2292a8f
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue