From 13d3a5d30513e375e7042fddd4bb703a877b0ab7 Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Tue, 13 Nov 2018 08:25:26 -0500 Subject: [PATCH] escape strings --- chatcommands.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chatcommands.lua b/chatcommands.lua index e8323ad..70d9fd1 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -22,7 +22,7 @@ minetest.register_chatcommand("mp", { return false, minetest.colorize(x_marketplace.colors.red, "MARKET PLACE: You need to write the item name you want to find. example: /mp find default:stone. See some suggestion from the store: ")..x_marketplace.store_get_random() end - local items = x_marketplace.store_find(params[2]) + local items = x_marketplace.store_find(minetest.formspec_escape(params[2])) if not items then return false, minetest.colorize(x_marketplace.colors.yellow, "MARKET PLACE: Oops there is no item like this in the store. Check out other items in the store: ")..x_marketplace.store_get_random() @@ -353,7 +353,7 @@ minetest.register_chatcommand("mp", { -- item not in store if not x_marketplace.store_list[params[2]] then - local suggestions = x_marketplace.store_find(params[2]) + local suggestions = x_marketplace.store_find(minetest.formspec_escape(params[2])) -- try suggest item from store, else show random items if suggestions then