Merge branch 'develop' into develop

This commit is contained in:
Min-Soo Kim 2018-07-29 11:49:27 +09:00 committed by GitHub
commit ec54bbd415
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 13 deletions

View file

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

View file

@ -73,7 +73,7 @@ class Mobile
$uatype = $uahash . ':' . (self::$_ismobile ? '1' : '0');
if ($cookie !== $uatype)
{
setcookie('rx_uatype', $uatype, 0);
setcookie('rx_uatype', $uatype, 0, null, null, Context::isAlwaysSSL());
$_COOKIE['rx_uatype'] = $uatype;
}

View file

@ -295,7 +295,7 @@ class Session
if(!$is_default_domain && !\Context::get('sso_response') && $_COOKIE['sso'] !== md5($current_domain))
{
// Set sso cookie to prevent multiple simultaneous SSO validation requests.
setcookie('sso', md5($current_domain), 0, '/');
setcookie('sso', md5($current_domain), 0, '/', null, \Context::isAlwaysSSL());
// Redirect to the default site.
$sso_request = Security::encrypt($current_url);

View file

@ -1055,7 +1055,8 @@ function getOuterHTML(obj) {
function setCookie(name, value, expire, path) {
var s_cookie = name + "=" + escape(value) +
((!expire) ? "" : ("; expires=" + expire.toGMTString())) +
"; path=" + ((!path) ? "/" : path);
"; path=" + ((!path) ? "/" : path) +
((enforce_ssl) ? ";secure" : "");
document.cookie = s_cookie;
}

View file

@ -48,14 +48,14 @@
<!-- COMMON JS VARIABLES -->
<script>
var default_url = "{\Rhymix\Framework\URL::encodeIdna(Context::getDefaultUrl())}";
var current_url = "{\Rhymix\Framework\URL::encodeIdna($current_url)}";
var request_uri = "{\Rhymix\Framework\URL::encodeIdna($request_uri)}";
var default_url = "{Context::encodeIdna(Context::getDefaultUrl())}";
var current_url = "{Context::encodeIdna($current_url)}";
var request_uri = "{Context::encodeIdna($request_uri)}";
var current_lang = xe.current_lang = "{$lang_type}";
var current_mid = {json_encode($mid ?: null)};
var http_port = {Context::get("_http_port") ?: 'null'};
var https_port = {Context::get("_https_port") ?: 'null'};
var enforce_ssl = {Context::get('_use_ssl') === 'always' ? 'true' : 'false'};
var enforce_ssl = {Context::isAlwaysSSL() ? 'true' : 'false'};
var ssl_actions = {json_encode(array_keys(Context::getSSLActions()))};
var xeVid = null;
</script>

View file

@ -7,7 +7,7 @@
<div class="xefu-dropzone">
<span class="xefu-btn fileinput-button xefu-act-selectfile">
<span><i class="xi-icon xi-file-upload"></i> {$lang->edit->upload_file}</span>
<input id="xe-fileupload" type="file" class="fileupload-processing " value="{$lang->edit->upload_file}" name="Filedata" data-auto-upload="true" data-editor-sequence="{$editor_sequence}" multiple />
<input id="xe-fileupload" type="file" class="fileupload-processing " name="Filedata" data-auto-upload="true" data-editor-sequence="{$editor_sequence}" multiple />
</span>
<p class="xefu-dropzone-message" cond="!$m">{$lang->ckeditor_about_file_drop_area}</p>

View file

@ -192,7 +192,7 @@ class memberView extends member
function dispMemberSignUpForm()
{
//setcookie for redirect url in case of going to member sign up
setcookie("XE_REDIRECT_URL", $_SERVER['HTTP_REFERER']);
setcookie("XE_REDIRECT_URL", $_SERVER['HTTP_REFERER'], 0, '/', null, Context::isAlwaysSSL());
$member_config = $this->member_config;

View file

@ -8,7 +8,7 @@
dt.setTime(dt.getTime() + (d * 24 * 60 * 60000));
e = "; expires=" + dt.toGMTString();
}
document.cookie = n + "=" + v + e + "; path=/";
document.cookie = n + "=" + v + e + "; path=/" + ((enforce_ssl) ? ";secure" : "");
}
var n = $('#nc_container');