From 2f4c6335d46cf40b7f3ab6b5f0867a06550c11f2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 1 Aug 2016 02:58:42 +0200 Subject: Escape more formspec strings --- init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 3d09fc7..499c1cf 100644 --- a/init.lua +++ b/init.lua @@ -278,9 +278,9 @@ doc.new_category("nodes", { local gstring, gcount = groups_to_string(data.def.groups) if gstring ~= nil then if gcount == 1 then - formstring = formstring .. "This block belongs to the "..gstring.." group.\n" + formstring = formstring .. "This block belongs to the "..minetest.formspec_escape(gstring).." group.\n" else - formstring = formstring .. "This block belongs to these groups: "..gstring..".\n" + formstring = formstring .. "This block belongs to these groups: "..minetest.formspec_escape(gstring)..".\n" end end @@ -399,8 +399,8 @@ doc.new_category("tools", { else formstring = formstring .. "item_image[11,0;1,1;"..data.itemstring.."]" end - formstring = formstring .. "textarea[0.25,1;10,8;;Description: "..longdesc.."\n\n" - formstring = formstring .. "Usage: "..usagehelp .. "\n\n" + formstring = formstring .. "textarea[0.25,1;10,8;;Description: "..minetest.formspec_escape(longdesc).."\n\n" + formstring = formstring .. "Usage: "..minetest.formspec_escape(usagehelp).. "\n\n" formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n" local yesno = function(bool) @@ -449,9 +449,9 @@ doc.new_category("tools", { local gstring, gcount = groups_to_string(data.def.groups) if gstring ~= nil then if gcount == 1 then - formstring = formstring .. "This tool belongs to the "..gstring.." group.\n" + formstring = formstring .. "This tool belongs to the "..minetest.formspec_escape(gstring).." group.\n" else - formstring = formstring .. "This tool belongs to these groups: "..gstring..".\n" + formstring = formstring .. "This tool belongs to these groups: "..minetest.formspec_escape(gstring)..".\n" end end @@ -478,8 +478,8 @@ doc.new_category("craftitems", { local longdesc = data.longdesc or "N/A" local usagehelp = data.usagehelp or "N/A" local formstring = "item_image[11,0;1,1;"..data.itemstring.."]" - formstring = formstring .. "textarea[0.25,1;10,8;;Description: "..longdesc.."\n\n" - formstring = formstring .. "Usage: "..usagehelp .. "\n\n" + formstring = formstring .. "textarea[0.25,1;10,8;;Description: "..minetest.formspec_escape(longdesc).."\n\n" + formstring = formstring .. "Usage: "..minetest.formspec_escape(usagehelp).. "\n\n" formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n" local yesno = function(bool) @@ -520,9 +520,9 @@ doc.new_category("craftitems", { local gstring, gcount = groups_to_string(data.def.groups) if gstring ~= nil then if gcount == 1 then - formstring = formstring .. "This item belongs to the "..gstring.." group.\n" + formstring = formstring .. "This item belongs to the "..minetest.formspec_escape(gstring).." group.\n" else - formstring = formstring .. "This item belongs to these groups: "..gstring..".\n" + formstring = formstring .. "This item belongs to these groups: "..minetest.formspec_escape(gstring)..".\n" end end -- cgit v1.2.3