mirror of
https://github.com/minetest-mods/filter.git
synced 2025-04-30 05:41:45 -04:00
Removes *all* white-spaces from message
this to ensure players can't get around this mod by adding spaces between words (e.g. "f uck")
This commit is contained in:
parent
99100857af
commit
685c94bd01
1 changed files with 2 additions and 1 deletions
3
init.lua
3
init.lua
|
@ -62,8 +62,9 @@ function filter.register_on_violation(func)
|
|||
end
|
||||
|
||||
function filter.check_message(name, message)
|
||||
local trimmed_msg = message:gsub(" ","")
|
||||
for _, w in ipairs(words) do
|
||||
if string.find(message:lower(), "%f[%a]" .. w .. "%f[%A]") then
|
||||
if string.find(trimmed_msg:lower(), "%f[%a]" .. w .. "%f[%A]") then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue