mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
Merge branch 'develop' into develop
This commit is contained in:
commit
ec54bbd415
8 changed files with 31 additions and 13 deletions
|
|
@ -306,7 +306,7 @@ class Context
|
|||
{
|
||||
if($_COOKIE['lang_type'] !== $lang_type)
|
||||
{
|
||||
setcookie('lang_type', $lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000, '/');
|
||||
setcookie('lang_type', $lang_type, time() + 86400 * 365, '/', null, self::isAlwaysSSL());
|
||||
}
|
||||
}
|
||||
elseif($_COOKIE['lang_type'])
|
||||
|
|
@ -322,7 +322,7 @@ class Context
|
|||
if(!strncasecmp($lang_code, $_SERVER['HTTP_ACCEPT_LANGUAGE'], strlen($lang_code)))
|
||||
{
|
||||
$lang_type = $lang_code;
|
||||
setcookie('lang_type', $lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000, '/');
|
||||
setcookie('lang_type', $lang_type, time() + 86400 * 365, '/', null, self::isAlwaysSSL());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -623,6 +623,23 @@ class Context
|
|||
return self::get('_use_ssl');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return ssl status
|
||||
*
|
||||
* @param boolen $purge_cache Set true to get uncached SSL_enforce value.
|
||||
* @return boolean (true|false)
|
||||
*/
|
||||
public static function isAlwaysSSL($purge_cache = false)
|
||||
{
|
||||
static $ssl_only = null;
|
||||
if(is_null($ssl_only) || $purge_cache === true)
|
||||
{
|
||||
$ssl_only = (self::get('site_module_info')->security === 'always' ? true : false);
|
||||
}
|
||||
return $ssl_only;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return default URL
|
||||
*
|
||||
|
|
@ -1775,7 +1792,7 @@ class Context
|
|||
return;
|
||||
}
|
||||
|
||||
if(self::get('_use_ssl') == 'always')
|
||||
if(self::isAlwaysSSL())
|
||||
{
|
||||
$ssl_mode = ENFORCE_SSL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue