1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 18:32:29 +01:00

handle a specific case with rtl character

This commit is contained in:
Madeline 2022-10-25 11:27:39 +11:00
parent aba1d02941
commit fdbd150ce3

View File

@ -22,6 +22,9 @@ export const BannedWords = {
find: (val: string) => {
InvisibleCharacters.forEach(x => val = val.replaceAll(x, ""));
return words.some((x) => val.indexOf(x) != -1);
var normal = words.some((x) => val.indexOf(x) != -1);
val = val.split("").reverse().join("");
var rtlOverride = words.some((x) => val.indexOf(x) != -1);
return normal || rtlOverride;
},
};