Skip to content

Commit

Permalink
formspec_escape at the correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tour-ist committed Jan 22, 2024
1 parent e07f7ce commit 9974e65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moremesecons_commandblock/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9974e65

Please sign in to comment.