From 39d03148e5d98ef5f9a31b131a79ff2bbd71a877 Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 8 Jul 2013 23:45:14 +0200 Subject: Fix serverlist not beeing escaped correctly Always use address for server Fix first (empty) element beeing selected after deleting last world --- builtin/mainmenu_helper.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'builtin/mainmenu_helper.lua') diff --git a/builtin/mainmenu_helper.lua b/builtin/mainmenu_helper.lua index a204b4a37..25ad072fd 100644 --- a/builtin/mainmenu_helper.lua +++ b/builtin/mainmenu_helper.lua @@ -77,9 +77,11 @@ function fs_escape_string(text) text = newtext end - text = text:gsub("%[","\\%[") - text = text:gsub("]","\\]") - text = text:gsub(";","\\;") + text = string.gsub(text,"\\","\\\\") + text = string.gsub(text,"%]","\\]") + text = string.gsub(text,"%[","\\[") + text = string.gsub(text,";","\\;") + text = string.gsub(text,",","\\,") end return text end -- cgit v1.2.3