Make WordPress Core

Changeset 15932


Ignore:
Timestamp:
10/23/2010 05:13:52 PM (13 years ago)
Author:
nacin
Message:

Don't make redundant str_replace calls in link-template. props duck_.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r15843 r15932  
    19581958        $home = get_blog_option( $blog_id, 'home' );
    19591959
    1960     $url = str_replace( 'http://', "$scheme://", $home );
     1960    if ( 'http' != $scheme )
     1961        $url = str_replace( 'http://', "$scheme://", $home );
    19611962
    19621963    if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
     
    20202021        $url = get_blog_option( $blog_id, 'siteurl' );
    20212022
    2022     $url = str_replace( 'http://', "{$scheme}://", $url );
     2023    if ( 'http' != $scheme )
     2024        $url = str_replace( 'http://', "{$scheme}://", $url );
    20232025
    20242026    if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
     
    21712173    }
    21722174
    2173     $url = 'http://' . $current_site->domain . $current_site->path;
    2174 
    2175     $url = str_replace( 'http://', "{$scheme}://", $url );
     2175    $url = $scheme . '://' . $current_site->domain . $current_site->path;
    21762176
    21772177    if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
     
    22062206        $scheme = is_ssl() && !is_admin() ? 'https' : 'http';
    22072207
    2208     $url = 'http://' . $current_site->domain . $current_site->path;
    2209 
    2210     $url = str_replace( 'http://', "$scheme://", $url );
     2208    $url = $scheme . '://' . $current_site->domain . $current_site->path;
    22112209
    22122210    if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
Note: See TracChangeset for help on using the changeset viewer.