From e07f7ced64d8c5ab6dee35520e1347e9858dc3ac Mon Sep 17 00:00:00 2001 From: tour Date: Sun, 21 Jan 2024 02:16:07 +0100 Subject: [PATCH 1/2] fix missing formspec escape --- moremesecons_commandblock/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moremesecons_commandblock/init.lua b/moremesecons_commandblock/init.lua index 64ca28c..eaf8df9 100644 --- a/moremesecons_commandblock/init.lua +++ b/moremesecons_commandblock/init.lua @@ -46,7 +46,7 @@ local function receive_fields(pos, _, fields, player) and player:get_player_name() ~= owner then return end - meta:set_string("commands", fields.commands) + meta:set_string("commands", minetest.formspec_escape(fields.commands)) initialize_data(meta) end From 9974e65bf00e8ad7779ecbb705dafdabf67ef646 Mon Sep 17 00:00:00 2001 From: tour Date: Mon, 22 Jan 2024 18:34:34 +0100 Subject: [PATCH 2/2] formspec_escape at the correct place --- moremesecons_commandblock/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moremesecons_commandblock/init.lua b/moremesecons_commandblock/init.lua index eaf8df9..6cf473f 100644 --- a/moremesecons_commandblock/init.lua +++ b/moremesecons_commandblock/init.lua @@ -4,7 +4,7 @@ local function initialize_data(meta) local commands = meta:get_string("commands") meta:set_string("formspec", "invsize[9,5;]" .. - "textarea[0.5,0.5;8.5,4;commands;Commands;"..commands.."]" .. + "textarea[0.5,0.5;8.5,4;commands;Commands;"..minetest.formspec_escape(commands).."]" .. "label[1,3.8;@nearest is replaced by the nearest player name ("..tostring(NEAREST_MAX_DISTANCE).." nodes max for the nearest distance)".."]" .. "button_exit[3.3,4.5;2,1;submit;Submit]") local owner = meta:get_string("owner") @@ -46,7 +46,7 @@ local function receive_fields(pos, _, fields, player) and player:get_player_name() ~= owner then return end - meta:set_string("commands", minetest.formspec_escape(fields.commands)) + meta:set_string("commands", fields.commands) initialize_data(meta) end