Fixed issue with add to other list form not correctly handling variables

This commit is contained in:
Kasper Rynning-Tønnesen
2019-01-22 17:52:12 +01:00
parent 9bd4fcdf32
commit d359c8e0c2
3 changed files with 7 additions and 2 deletions

View File

@@ -467,7 +467,7 @@ module.exports = function() {
if(arr.hasOwnProperty("list")) { if(arr.hasOwnProperty("list")) {
arr.list = Functions.encodeChannelName(arr.list); arr.list = Functions.encodeChannelName(arr.list);
} }
if(coll !== undefined) { if(coll !== undefined && ((arr.hasOwnProperty("offsiteAdd") && !arr.offsiteAdd) || !arr.hasOwnProperty("offsiteAdd"))) {
try { try {
coll = arr.list;//.replace(/ /g,''); coll = arr.list;//.replace(/ /g,'');
if(coll.length == 0) return; if(coll.length == 0) return;
@@ -478,6 +478,8 @@ module.exports = function() {
} catch(e) { } catch(e) {
return; return;
} }
} else if(arr.hasOwnProperty("offsiteAdd") && arr.offsiteAdd) {
arr.list = Functions.removeEmojis(arr.list).toLowerCase();
} }
ListChange.add_function(arr, coll, guid, offline, socket); ListChange.add_function(arr, coll, guid, offline, socket);
}); });

View File

@@ -401,7 +401,9 @@ function add_function(arr, coll, guid, offline, socket) {
socket.emit('update_required', result); socket.emit('update_required', result);
return; return;
} }
if(arr.hasOwnProperty("offsiteAdd") && arr.offsiteAdd) {
coll = arr.list;
}
Functions.getSessionAdminUser(Functions.getSession(socket), coll, function(userpass, adminpass) { Functions.getSessionAdminUser(Functions.getSession(socket), coll, function(userpass, adminpass) {
if(adminpass != "" || arr.adminpass == undefined) { if(adminpass != "" || arr.adminpass == undefined) {
arr.adminpass = Functions.hash_pass(adminpass); arr.adminpass = Functions.hash_pass(adminpass);

View File

@@ -1802,6 +1802,7 @@ function addDynamicListeners() {
} else if(event.keyCode == 32 && document.querySelector(".search-container").classList.contains("hide") && window.location.pathname != "/" && } else if(event.keyCode == 32 && document.querySelector(".search-container").classList.contains("hide") && window.location.pathname != "/" &&
document.querySelector("#text-chat-input") != document.activeElement && document.querySelector("#text-chat-input") != document.activeElement &&
document.querySelector("#password") != document.activeElement && document.querySelector("#password") != document.activeElement &&
document.querySelector("#other-list-name-add") != document.activeElement &&
document.querySelector("#user-pass-input") != document.activeElement && document.querySelector("#user-pass-input") != document.activeElement &&
document.querySelector("#thumbnail_input") != document.activeElement && document.querySelector("#thumbnail_input") != document.activeElement &&
document.querySelector("#rules_input") != document.activeElement && document.querySelector("#rules_input") != document.activeElement &&