Make WordPress Core

Ticket #14867: 14867.diff

File 14867.diff, 1.4 KB (added by scribu, 15 years ago)
  • wp-includes/ms-blogs.php

     
    1919}
    2020
    2121function get_blogaddress_by_id( $blog_id ) {
     22        $protocol = is_ssl() ? ' https://' : ' http://';
    2223        $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
    23         return esc_url( 'http://' . $bloginfo->domain . $bloginfo->path );
     24        return esc_url( $protocol . $bloginfo->domain . $bloginfo->path );
    2425}
    2526
    2627function get_blogaddress_by_name( $blogname ) {
     
    3839        return esc_url( $url . '/' );
    3940}
    4041
    41 function get_blogaddress_by_domain( $domain, $path ){
     42function get_blogaddress_by_domain( $domain, $path ) {
     43        $protocol = is_ssl() ? ' https://' : ' http://';
     44
    4245        if ( is_subdomain_install() ) {
    43                 $url = "http://".$domain.$path;
     46                $url = $protocol.$domain.$path;
    4447        } else {
    4548                if ( $domain != $_SERVER['HTTP_HOST'] ) {
    4649                        $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
    47                         $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
     50                        $url = $protocol . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
    4851                        // we're not installing the main blog
    4952                        if ( $blogname != 'www.' )
    5053                                $url .= $blogname . '/';
    5154                } else { // main blog
    52                         $url = 'http://' . $domain . $path;
     55                        $url = $protocol . $domain . $path;
    5356                }
    5457        }
     58
    5559        return esc_url( $url );
    5660}
    5761