Removed spacing from listnames serverside

This commit is contained in:
Kasper Rynning-Tønnesen
2015-07-07 21:31:54 +02:00
parent 04652b0a8e
commit 6fc2bac6ac

View File

@@ -155,6 +155,8 @@ io.on('connection', function(socket){
{ {
in_list = true; in_list = true;
coll = list.toLowerCase(); coll = list.toLowerCase();
coll = decodeURIComponent(coll);
coll = coll.replace(/\s+/g, '');
socket.join(coll); socket.join(coll);
socket.join(short_id); socket.join(short_id);
socket.emit("id", short_id); socket.emit("id", short_id);
@@ -552,6 +554,8 @@ function left_channel(coll, guid, name, short_id)
function del(params, socket) function del(params, socket)
{ {
var coll = params[0].toLowerCase(); var coll = params[0].toLowerCase();
coll = decodeURIComponent(coll);
coll = coll.replace(/\s+/g, '');
db.collection(coll).find({views:{$exists:true}}, function(err, docs){ db.collection(coll).find({views:{$exists:true}}, function(err, docs){
if(docs !== null && docs.length != 0 && docs[0]["adminpass"] == hash_pass(params[3])) if(docs !== null && docs.length != 0 && docs[0]["adminpass"] == hash_pass(params[3]))
{ {