Don't make redundant str_replace calls in link-template. props duck_.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
81025846b1
commit
3dfec1ee81
|
@ -1957,6 +1957,7 @@ function get_home_url( $blog_id = null, $path = '', $scheme = null ) {
|
|||
else
|
||||
$home = get_blog_option( $blog_id, 'home' );
|
||||
|
||||
if ( 'http' != $scheme )
|
||||
$url = str_replace( 'http://', "$scheme://", $home );
|
||||
|
||||
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
|
||||
|
@ -2019,6 +2020,7 @@ function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
|
|||
else
|
||||
$url = get_blog_option( $blog_id, 'siteurl' );
|
||||
|
||||
if ( 'http' != $scheme )
|
||||
$url = str_replace( 'http://', "{$scheme}://", $url );
|
||||
|
||||
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
|
||||
|
@ -2170,9 +2172,7 @@ function network_site_url( $path = '', $scheme = null ) {
|
|||
$scheme = ( is_ssl() ? 'https' : 'http' );
|
||||
}
|
||||
|
||||
$url = 'http://' . $current_site->domain . $current_site->path;
|
||||
|
||||
$url = str_replace( 'http://', "{$scheme}://", $url );
|
||||
$url = $scheme . '://' . $current_site->domain . $current_site->path;
|
||||
|
||||
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
|
||||
$url .= ltrim($path, '/');
|
||||
|
@ -2205,9 +2205,7 @@ function network_home_url( $path = '', $scheme = null ) {
|
|||
if ( !in_array($scheme, array('http', 'https')) )
|
||||
$scheme = is_ssl() && !is_admin() ? 'https' : 'http';
|
||||
|
||||
$url = 'http://' . $current_site->domain . $current_site->path;
|
||||
|
||||
$url = str_replace( 'http://', "$scheme://", $url );
|
||||
$url = $scheme . '://' . $current_site->domain . $current_site->path;
|
||||
|
||||
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
|
||||
$url .= ltrim( $path, '/' );
|
||||
|
|
Loading…
Reference in New Issue