When SSL is optional, redirect to http after writing (#1939)

This commit is contained in:
Kijin Sung 2016-07-26 13:32:08 +09:00
parent 7822e9c070
commit 05128b9f4b

View file

@ -294,12 +294,17 @@ jQuery(function($) {
}
}
re = /http:\/\/([^:\/]+)(:\d+|)/i;
re = /https?:\/\/([^:\/]+)(:\d+|)/i;
if (bUseSSL && re.test(uri)) {
toReplace = 'https://'+RegExp.$1;
if (window.https_port && https_port != 443) toReplace += ':' + https_port;
uri = uri.replace(re, toReplace);
}
if (!bUseSSL && re.test(uri)) {
toReplace = 'http://'+RegExp.$1;
if (window.http_port && http_port != 80) toReplace += ':' + http_port;
uri = uri.replace(re, toReplace);
}
// insert index.php if it isn't included
uri = uri.replace(/\/(index\.php)?\?/, '/index.php?');