From 0a4e820ba1e25f0ba035b9bed16a898e3772d927 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Sun, 14 Feb 2010 00:12:08 +0000 Subject: [PATCH] use current site domain for cookie domain when cookie domain not set, See #12142 git-svn-id: https://develop.svn.wordpress.org/trunk@13127 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/ms-default-constants.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-includes/ms-default-constants.php b/wp-includes/ms-default-constants.php index 75ea1e6e79..49746ef044 100644 --- a/wp-includes/ms-default-constants.php +++ b/wp-includes/ms-default-constants.php @@ -61,8 +61,12 @@ function ms_cookie_constants( ) { /** * @since 2.0.0 */ - if ( !defined('COOKIE_DOMAIN') ) - define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain); + if ( !defined('COOKIE_DOMAIN') ) { + if ( isset( $current_site->cookie_domain ) ) + define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain); + else + define('COOKIE_DOMAIN', '.' . $current_site->domain); + } } /** @@ -85,4 +89,4 @@ function ms_file_constants( ) { if ( !defined( 'WPMU_ACCEL_REDIRECT' ) ) define( 'WPMU_ACCEL_REDIRECT', false ); } -?> \ No newline at end of file +?>