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")) {
arr.list = Functions.encodeChannelName(arr.list);
}
if(coll !== undefined) {
if(coll !== undefined && ((arr.hasOwnProperty("offsiteAdd") && !arr.offsiteAdd) || !arr.hasOwnProperty("offsiteAdd"))) {
try {
coll = arr.list;//.replace(/ /g,'');
if(coll.length == 0) return;
@@ -478,6 +478,8 @@ module.exports = function() {
} catch(e) {
return;
}
} else if(arr.hasOwnProperty("offsiteAdd") && arr.offsiteAdd) {
arr.list = Functions.removeEmojis(arr.list).toLowerCase();
}
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);
return;
}
if(arr.hasOwnProperty("offsiteAdd") && arr.offsiteAdd) {
coll = arr.list;
}
Functions.getSessionAdminUser(Functions.getSession(socket), coll, function(userpass, adminpass) {
if(adminpass != "" || arr.adminpass == undefined) {
arr.adminpass = Functions.hash_pass(adminpass);