Remove ssl_actions and add rewrite_level to inline JS

This commit is contained in:
Kijin Sung 2021-01-20 23:53:58 +09:00
parent e1fabe4242
commit 64baf4e8e3
3 changed files with 3 additions and 14 deletions

View file

@ -532,10 +532,6 @@ jQuery(function($) {
filename = '';
}
if(protocol !== 'https' && queries.act && $.inArray(queries.act, window.ssl_actions) !== -1) {
protocol = 'https';
}
return uri.protocol(protocol).port(port || null).normalizePort().filename(filename);
}
@ -1103,6 +1099,8 @@ var Base64 = {
* 하위호환용으로 남겨 놓음
* ------------------------------------------- */
window.ssl_actions = [];
if(typeof(resizeImageContents) == 'undefined') {
window.resizeImageContents = function() {};
}

View file

@ -42,16 +42,6 @@
// Decide whether or not to use SSL.
var url = request_uri;
if ($.isArray(ssl_actions) && params.act && $.inArray(params.act, ssl_actions) >= 0) {
url = default_url || request_uri;
var port = window.https_port || 443;
var _ul = $("<a>").attr("href", url)[0];
var target = "https://" + _ul.hostname.replace(/:\d+$/, "");
if (port != 443) target += ":" + port;
if (_ul.pathname[0] != "/") target += "/";
target += _ul.pathname;
url = target.replace(/\/$/, "") + "/";
}
// Check whether this is a cross-domain request. If so, use an alternative method.
if (!isSameOrigin(location.href, url)) return send_by_form(url, params);

View file

@ -57,6 +57,7 @@
var https_port = {Context::get("_https_port") ?: 'null'};
var enforce_ssl = {$site_module_info->security === 'always' ? 'true' : 'false'};
var cookies_ssl = {config('session.use_ssl_cookies') ? 'true' : 'false'};
var rewrite_level = {intval(\Rhymix\Framework\Router::getRewriteLevel())};
var ssl_actions = [];
</script>
</head>