mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-28 11:40:24 +01:00
Allow Lua regexs in search, and check for bad ones
This commit is contained in:
parent
d30b33ba24
commit
b69fc35c88
11
internal.lua
11
internal.lua
@ -92,14 +92,9 @@ function unified_inventory.apply_filter(player, filter)
|
||||
local player_name = player:get_player_name()
|
||||
local size = 0
|
||||
local lfilter = string.lower(filter)
|
||||
if lfilter ~= "" then
|
||||
for c in lfilter:gmatch(".") do
|
||||
if c == '[' or c == ']' or c == '{' or c == '}' or
|
||||
c == '(' or c == ')' or c == '%' then
|
||||
lfilter = ""
|
||||
break
|
||||
end
|
||||
end
|
||||
if not pcall(function() ("technic:test"):find(lfilter) end) then
|
||||
-- Filter is invalid
|
||||
lfilter = ""
|
||||
end
|
||||
unified_inventory.filtered_items_list[player_name]={}
|
||||
for name, def in pairs(minetest.registered_items) do
|
||||
|
Loading…
Reference in New Issue
Block a user