mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Fix doChangeLangType() redirecting to main page when short URL is used
https://xetown.com/questions/1381097
This commit is contained in:
parent
4bac63f387
commit
e33d8569bc
1 changed files with 6 additions and 2 deletions
|
|
@ -486,7 +486,7 @@ jQuery(function($) {
|
|||
var filename = uri.filename() || 'index.php';
|
||||
var queries = uri.search(true);
|
||||
|
||||
if(window.XE.isSameHost(uri.toString()) && $.isEmptyObject(queries)) {
|
||||
if(window.XE.isSameHost(uri.toString()) && filename === 'index.php' && $.isEmptyObject(queries)) {
|
||||
filename = '';
|
||||
}
|
||||
|
||||
|
|
@ -721,7 +721,11 @@ function doChangeLangType(obj) {
|
|||
var val = obj.options[obj.selectedIndex].value;
|
||||
setLangType(val);
|
||||
}
|
||||
location.href = location.href.setQuery('l', '');
|
||||
if(location.href.match(/[?&]l=[a-z]+/)) {
|
||||
location.href = location.href.setQuery('l', '');
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
function setLangType(lang_type) {
|
||||
XE.cookie.set("lang_type", lang_type, { path: "/", expires: 3650 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue