aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChimneySwift <pono797@gmail.com>2018-11-10 23:46:51 +1000
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-11-10 14:46:51 +0100
commit6c42ebfafa7bc5762fe7ad64b4b9087ba1bc3c38 (patch)
tree616a532c0635b8dfd5865deca918bb84c47b3515
parent57a2f3e4c485595d68a49b576a52cd91ace23073 (diff)
downloadminetest-6c42ebfafa7bc5762fe7ad64b4b9087ba1bc3c38.tar.gz
minetest-6c42ebfafa7bc5762fe7ad64b4b9087ba1bc3c38.tar.bz2
minetest-6c42ebfafa7bc5762fe7ad64b4b9087ba1bc3c38.zip
Escape special characters when searching the server list (#7842)
Simple fix to stop searching for "[" or other special characters causing a crash.
-rw-r--r--builtin/mainmenu/tab_online.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua
index 8e88a7743..a057d0973 100644
--- a/builtin/mainmenu/tab_online.lua
+++ b/builtin/mainmenu/tab_online.lua
@@ -256,6 +256,7 @@ local function main_button_handler(tabview, fields, name, tabdata)
-- setup the keyword list
local keywords = {}
for word in input:gmatch("%S+") do
+ word = word:gsub("(%W)", "%%%1")
table.insert(keywords, word)
end