1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 20:21:51 +02:00

Issue #1072 - Give subdomain priority over main domain when detecting language.

This commit is contained in:
Cameron 2015-06-25 18:22:47 -07:00
parent f13e49ae6f
commit ae20b9f703

View File

@ -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);