diff --git a/composer.json b/composer.json index 049e6e9..31f9975 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,6 @@ ], "type": "wordpress-muplugin", "require": { - "composer/installers": "~1.0" + "composer/installers": "~1.0 || ~2.0" } } diff --git a/sso.php b/sso.php index 74fcdca..0083223 100644 --- a/sso.php +++ b/sso.php @@ -73,13 +73,15 @@ function bootstrap() { */ function initialize_cookie_domain() { if ( empty( $GLOBALS['mercator_current_mapping'] ) ) { - return; - } + //return; + $cookie_domain = strtolower( wp_unslash( $_SERVER['HTTP_HOST'] ) ); + } else { + // Do the ms-settings dance, again. + $current_mapping = $GLOBALS['mercator_current_mapping']; - // Do the ms-settings dance, again. - $current_mapping = $GLOBALS['mercator_current_mapping']; + $cookie_domain = $current_mapping->get_domain(); + } - $cookie_domain = $current_mapping->get_domain(); if ( substr( $cookie_domain, 0, 4 ) === 'www.' ) { $cookie_domain = substr( $cookie_domain, 4 ); }