mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 04:32:35 +01:00
handle a specific case with rtl character
This commit is contained in:
parent
252bc880e8
commit
e176aebf65
@ -22,6 +22,9 @@ export const BannedWords = {
|
|||||||
|
|
||||||
find: (val: string) => {
|
find: (val: string) => {
|
||||||
InvisibleCharacters.forEach(x => val = val.replaceAll(x, ""));
|
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;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user