diff options
author | Kahrl <kahrl@gmx.net> | 2014-12-08 07:47:51 +0100 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2014-12-08 07:48:51 +0100 |
commit | d0be8238074dd15254838e4af12069ff4bef67d2 (patch) | |
tree | e856e8502f4ac314492173abd42de5e239def9ef /builtin/mainmenu/tab_multiplayer.lua | |
parent | 2fd3d5202051e03303ac2b8e76976a7c4c8477f3 (diff) | |
download | minetest-d0be8238074dd15254838e4af12069ff4bef67d2.tar.gz minetest-d0be8238074dd15254838e4af12069ff4bef67d2.tar.bz2 minetest-d0be8238074dd15254838e4af12069ff4bef67d2.zip |
Always escape user provided data in mainmenu fields
Diffstat (limited to 'builtin/mainmenu/tab_multiplayer.lua')
-rw-r--r-- | builtin/mainmenu/tab_multiplayer.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/mainmenu/tab_multiplayer.lua b/builtin/mainmenu/tab_multiplayer.lua index c3a7d921e..b235eaecf 100644 --- a/builtin/mainmenu/tab_multiplayer.lua +++ b/builtin/mainmenu/tab_multiplayer.lua @@ -24,8 +24,10 @@ local function get_formspec(tabview, name, tabdata) "label[1,-0.25;".. fgettext("Favorites:") .. "]".. "label[1,4.25;".. fgettext("Address/Port") .. "]".. "label[9,2.75;".. fgettext("Name/Password") .. "]" .. - "field[1.25,5.25;5.5,0.5;te_address;;" ..core.setting_get("address") .."]" .. - "field[6.75,5.25;2.25,0.5;te_port;;" ..core.setting_get("remote_port") .."]" .. + "field[1.25,5.25;5.5,0.5;te_address;;" .. + core.formspec_escape(core.setting_get("address")) .."]" .. + "field[6.75,5.25;2.25,0.5;te_port;;" .. + core.formspec_escape(core.setting_get("remote_port")) .."]" .. "checkbox[1,3.6;cb_public_serverlist;".. fgettext("Public Serverlist") .. ";" .. dump(core.setting_getbool("public_serverlist")) .. "]" @@ -36,7 +38,8 @@ local function get_formspec(tabview, name, tabdata) retval = retval .. "button[9,4.95;2.5,0.5;btn_mp_connect;".. fgettext("Connect") .. "]" .. - "field[9.3,3.75;2.5,0.5;te_name;;" ..core.setting_get("name") .."]" .. + "field[9.3,3.75;2.5,0.5;te_name;;" .. + core.formspec_escape(core.setting_get("name")) .."]" .. "pwdfield[9.3,4.5;2.5,0.5;te_pwd;]" .. "textarea[9.3,0.25;2.5,2.75;;" |