From ae20b9f70334aa4c17b395c3b1b745f7c71269a0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 25 Jun 2015 18:22:47 -0700 Subject: [PATCH] Issue #1072 - Give subdomain priority over main domain when detecting language. --- e107_handlers/language_class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/e107_handlers/language_class.php b/e107_handlers/language_class.php index 40890b60b..394f24890 100644 --- a/e107_handlers/language_class.php +++ b/e107_handlers/language_class.php @@ -463,12 +463,7 @@ class language{ if(false !== $this->detect && !$force) return $this->detect; $this->_cookie_domain = ''; - if(!empty($pref['multilanguage_domain']) && ($newLang = $this->isLangDomain(e_DOMAIN))) - { - $detect_language = $this->isValid($newLang); - $this->_cookie_domain = ".".e_DOMAIN; - } - elseif(vartrue($pref['multilanguage_subdomain']) && $this->isLangDomain(e_DOMAIN) && (defset('MULTILANG_SUBDOMAIN') !== false)) + if(vartrue($pref['multilanguage_subdomain']) && $this->isLangDomain(e_DOMAIN) && (defset('MULTILANG_SUBDOMAIN') !== false)) { $detect_language = (e_SUBDOMAIN) ? $this->isValid(e_SUBDOMAIN) : $pref['sitelanguage']; // Done in session handler now, based on MULTILANG_SUBDOMAIN value @@ -476,6 +471,11 @@ class language{ $this->_cookie_domain = ".".e_DOMAIN; define('MULTILANG_SUBDOMAIN',true); } + elseif(!empty($pref['multilanguage_domain']) && ($newLang = $this->isLangDomain(e_DOMAIN))) + { + $detect_language = $this->isValid($newLang); + $this->_cookie_domain = ".".e_DOMAIN; + } elseif(e_MENU && ($detect_language = $this->isValid(e_MENU))) // { define("e_LANCODE",true);