WordPress.org

Make WordPress Core

Ticket #12735: 12736.2.patch

File 12736.2.patch, 1.5 KB (added by andreasnrb, 8 years ago)

Removed the site path stuff. Fixed the home_url and get_blogaddress_by_name bug

  • wp-includes/link-template.php

     
    18371837        if ( empty($blog_id) || !is_multisite() )
    18381838                $home = get_option('home');
    18391839        else
    1840                 $home = untrailingslashit(get_blogaddress_by_id($blog_id));
     1840                $home = get_blog_option($blog_id,'home');
    18411841
    18421842        $url = str_replace( 'http://', "$scheme://", $home );
    18431843
     
    18991899        if ( empty($blog_id) || !is_multisite() )
    19001900                $url = get_option('siteurl');
    19011901        else
    1902                 $url = untrailingslashit(get_blogaddress_by_id($blog_id));
     1902                $url = get_blog_option($blog_id,'siteurl');
    19031903
    19041904        $url = str_replace( 'http://', "{$scheme}://", $url );
    19051905
  • wp-includes/ms-blogs.php

     
    2727        global $current_site;
    2828
    2929        if ( is_subdomain_install() ) {
     30                if(strpos($current_site->domain,$blogname)!==false)
     31                        return esc_url('http://'.$current_site->domain . $current_site->path);         
    3032                if ( $blogname == 'main' )
    3133                        $blogname = 'www';
    3234                return esc_url( 'http://' . $blogname . '.' . $current_site->domain . $current_site->path );
    3335        } else {
     36                if(strpos($current_site->path,$blogname)!==false)
     37                        return esc_url( 'http://' . $current_site->domain . $current_site->path);
    3438                return esc_url( 'http://' . $current_site->domain . $current_site->path . $blogname . '/' );
    3539        }
    3640}