From e9fb756adf0c490aafbede59f9378a3d16693f0b Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 23 Nov 2018 16:03:05 +0100 Subject: [PATCH] Fixed issue with ChatFilter not ignoring ?!. etc. --- Plugins/ChatFilter/ChatFilter.plugin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/ChatFilter/ChatFilter.plugin.js b/Plugins/ChatFilter/ChatFilter.plugin.js index a60851d003..4a2860c88b 100644 --- a/Plugins/ChatFilter/ChatFilter.plugin.js +++ b/Plugins/ChatFilter/ChatFilter.plugin.js @@ -32,7 +32,7 @@ class ChatFilter { getDescription () {return "Allows the user to censor words or block complete messages based on words in the chatwindow.";} - getVersion () {return "3.2.8";} + getVersion () {return "3.2.9";} getAuthor () {return "DevilBro";} @@ -334,7 +334,7 @@ class ChatFilter { if (reg.test(url)) blocked = true; } else if (string.indexOf("<") != 0) { - string.replace(/\n/g, " \n ").split(" ").forEach((word) => { + string.replace(/([\?\¿\!\¡\.\"\n])/g, " $1 ").split(" ").forEach((word) => { if (word && reg.test(word)) blocked = true; }); } @@ -378,7 +378,7 @@ class ChatFilter { } else if (string.indexOf("<") != 0) { var newstring = []; - string.replace(/\n/g, " \n ").split(" ").forEach((word) => { + string.replace(/([\?\¿\!\¡\.\"\n])/g, " $1 ").split(" ").forEach((word) => { if (word && reg.test(word)) { censored = true; newstring.push(BDFDB.encodeToHTML(censoredReplace)); @@ -393,7 +393,7 @@ class ChatFilter { } if (censored) { - newhtml = strings.join("").replace(/\s\n\s/g, "\n"); + newhtml = strings.join("").replace(/ ([\?\¿\!\¡\.\"\n]) /g, "$1"); $(message) .html(newhtml) .addClass("censored")