Make WordPress Core

Ticket #18242: 18242.2.patch

File 18242.2.patch, 862 bytes (added by SergeyBiryukov, 14 years ago)
  • wp-includes/ms-blogs.php

     
    7373        if ( is_subdomain_install() ) {
    7474                $url = "http://" . $domain.$path;
    7575        } else {
    76                 if ( $domain != $_SERVER['HTTP_HOST'] ) {
     76                $domain_root = substr( $domain, strpos( $domain, '.' ) + 1 );
     77                $host_root = substr( $_SERVER['HTTP_HOST'], strpos( $_SERVER['HTTP_HOST'], '.' ) + 1 );
     78
     79                if ( $domain != $_SERVER['HTTP_HOST'] && $domain_root == $host_root ) {
    7780                        $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
    78                         $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
     81                        $url = 'http://' . $domain_root . $path;
    7982                        // we're not installing the main blog
    8083                        if ( $blogname != 'www.' )
    8184                                $url .= $blogname . '/';