stricter pattern matching

This commit is contained in:
OgelGames 2021-11-05 22:02:11 +11:00
parent c4786e8d3e
commit 3f7e7b1f93
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
-- Check clicked item image button
local clicked_item
for name, value in pairs(fields) do
local new_dir, mangled_item = string.match(name, "item_button_([a-z]+)_(.*)$")
local new_dir, mangled_item = string.match(name, "^[0-9]*_?item_button_([a-z]+)_(.*)$")
if new_dir and mangled_item then
clicked_item = unified_inventory.demangle_for_formspec(mangled_item)
if string.sub(clicked_item, 1, 6) == "group:" then