Make WordPress Core

Ticket #27003: 27003.21.diff

File 27003.21.diff, 852 bytes (added by jeremyfelt, 11 years ago)

Proper cookie domain

  • src/wp-includes/ms-settings.php

     
    113113                ms_not_installed();
    114114        }
    115115
    116         // @todo What if the domain of the network doesn't match the current site?
    117         $current_site->cookie_domain = $current_site->domain;
     116        // If the site domain differs from the network domain, defer to the site for cookies.
     117        if ( isset( $current_blog->domain ) && $current_blog->domain !== $current_site->domain ) {
     118                $current_site->cookie_domain = $current_blog->domain;
     119        } else {
     120                $current_site->cookie_domain = $current_site->domain;
     121        }
    118122        if ( 'www.' === substr( $current_site->cookie_domain, 0, 4 ) ) {
    119123                $current_site->cookie_domain = substr( $current_site->cookie_domain, 4 );
    120124        }