mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed issue where filter was filtering bad words someplaces, and somewhere it doesnt
This commit is contained in:
@@ -67,6 +67,8 @@ function chat(msg, guid, offline, socket) {
|
||||
return;
|
||||
}
|
||||
var coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
Functions.getSessionAdminUser(Functions.getSession(socket), coll, function(userpass) {
|
||||
if(userpass != "" || msg.pass == undefined) {
|
||||
msg.pass = userpass;
|
||||
@@ -118,7 +120,8 @@ function all_chat(msg, guid, offline, socket) {
|
||||
}
|
||||
var coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
var data = msg.data;
|
||||
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
Functions.check_inlist(coll, guid, socket, offline);
|
||||
if(data !== "" && data !== undefined && data !== null &&
|
||||
data.length < 151 && data.replace(/\s/g, '').length){
|
||||
|
||||
@@ -64,6 +64,8 @@ module.exports = function() {
|
||||
socketid = msg.socket_id;
|
||||
socket.zoff_id = socketid;
|
||||
coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
in_list = true;
|
||||
chromecast_object = true;
|
||||
socket.join(coll);
|
||||
@@ -156,6 +158,8 @@ module.exports = function() {
|
||||
offline = true;
|
||||
if(channel != "") coll = channel;
|
||||
if(coll !== undefined) {
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
|
||||
db.collection("connected_users").findAndModify({
|
||||
query: {"_id": coll},
|
||||
@@ -254,7 +258,6 @@ module.exports = function() {
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(msg.hasOwnProperty("offline") && msg.offline) {
|
||||
offline = true;
|
||||
}
|
||||
@@ -396,6 +399,8 @@ module.exports = function() {
|
||||
socket.on("left_channel", function(msg) {
|
||||
if(msg.hasOwnProperty("channel") && msg.channel != "" && typeof(msg.channel) == "string") {
|
||||
coll = msg.channel.replace(/ /g,'');
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
List.left_channel(coll, guid, short_id, in_list, socket, false);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -47,6 +47,8 @@ function list(msg, guid, coll, offline, socket) {
|
||||
return;
|
||||
}
|
||||
coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
var pass = crypto.createHash('sha256').update(Functions.decrypt_string(msg.pass)).digest("base64");
|
||||
db.collection('frontpage_lists').find({"_id": coll}, function(err, frontpage_lists){
|
||||
if(frontpage_lists.length == 1) {
|
||||
@@ -119,6 +121,7 @@ function skip(list, guid, coll, offline, socket) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!list.hasOwnProperty("id") || !list.hasOwnProperty("channel") ||
|
||||
typeof(list.id) != "string" || typeof(list.channel) != "string") {
|
||||
var result = {
|
||||
|
||||
@@ -469,6 +469,8 @@ function voteUndecided(msg, coll, guid, offline, socket) {
|
||||
return;
|
||||
}
|
||||
coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
Functions.getSessionAdminUser(Functions.getSession(socket), coll, function(userpass, adminpass) {
|
||||
if(adminpass != "" || msg.adminpass == undefined) {
|
||||
msg.adminpass = adminpass;
|
||||
@@ -533,7 +535,8 @@ function shuffle(msg, coll, guid, offline, socket) {
|
||||
return;
|
||||
}
|
||||
coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
Functions.getSessionAdminUser(Functions.getSession(socket), coll, function(userpass, adminpass) {
|
||||
if(adminpass != "" || msg.adminpass == undefined) {
|
||||
msg.adminpass = adminpass;
|
||||
@@ -654,6 +657,8 @@ function delete_all(msg, coll, guid, offline, socket) {
|
||||
coll = msg.channel;
|
||||
}
|
||||
coll = coll.replace(/ /g,'');
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
Functions.getSessionAdminUser(Functions.getSession(socket), coll, function(userpass, adminpass, gotten) {
|
||||
if(adminpass != "" || msg.adminpass == undefined) {
|
||||
msg.adminpass = adminpass;
|
||||
|
||||
Reference in New Issue
Block a user