aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-09-04 16:15:27 +0200
committerorwell96 <orwell@bleipb.de>2020-09-04 16:15:27 +0200
commit0aa83e49322e7df2ccfb6e4b8490bc10163d593a (patch)
tree9c446a4c175072907131f3c3bb73d29b8c8237db
parent00be2b5b5fc75de16c178d503ed557e5ddf28c2a (diff)
downloadadvtrains-0aa83e49322e7df2ccfb6e4b8490bc10163d593a.tar.gz
advtrains-0aa83e49322e7df2ccfb6e4b8490bc10163d593a.tar.bz2
advtrains-0aa83e49322e7df2ccfb6e4b8490bc10163d593a.zip
Escape fields in wagon properties (H#158)
-rw-r--r--advtrains/wagons.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index f2ff897..d10dce0 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -810,8 +810,8 @@ function wagon:show_wagon_properties(pname)
]]
local data = advtrains.wagons[self.id]
local form="size[5,5]"
- form = form .. "field[0.5,1;4.5,1;whitelist;Allow these players to access your wagon:;"..(data.whitelist or "").."]"
- form = form .. "field[0.5,2;4.5,1;roadnumber;Wagon road number:;"..(data.roadnumber or "").."]"
+ form = form .. "field[0.5,1;4.5,1;whitelist;Allow these players to access your wagon:;"..minetest.formspec_escape(data.whitelist or "").."]"
+ form = form .. "field[0.5,2;4.5,1;roadnumber;Wagon road number:;"..minetest.formspec_escape(data.roadnumber or "").."]"
local fc = ""
if data.fc then
fc = table.concat(data.fc, "!")
@@ -825,7 +825,7 @@ function wagon:show_wagon_properties(pname)
form=form.."label[1.5,3.5;Current FC:]"
local cur = data.fc[data.fcind] or ""
- form=form.."label[1.5,3.75;"..cur.."]"
+ form=form.."label[1.5,3.75;"..minetest.formspec_escape(cur).."]"
form=form.."button[3.5,3.5;1,1;fcn;next FC]"
end
form=form.."button_exit[0.5,4.5;4,1;save;"..attrans("Save wagon properties").."]"