From 99c15de631ca26d918fd71f483779456518a25d0 Mon Sep 17 00:00:00 2001 From: wpmuguru 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: http://svn.automattic.com/wordpress/trunk@13127 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 75ea1e6e7..49746ef04 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 +?>