From 580508fa37df08c4fed19edb8908aa1677a789af Mon Sep 17 00:00:00 2001 From: bell07 Date: Mon, 27 Aug 2018 21:15:55 +0200 Subject: [PATCH] Fix showing up complex images Some complex texture strings contains [ character that needs to be escaped. Issue found with [halloween](https://github.com/GreenXenith/halloween) preview texture on player tab page button in smart_inventory. The button was dissapeared, after this change visible again. --- smartfs.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smartfs.lua b/smartfs.lua index b5d7397..53184ca 100644 --- a/smartfs.lua +++ b/smartfs.lua @@ -885,7 +885,7 @@ smartfs.element("button", { self.data.pos.x..","..self.data.pos.y..";".. self.data.size.w..","..self.data.size.h..";" if self.data.image then - specstring = specstring..self.data.image..";" + specstring = specstring..minetest.formspec_escape(self.data.image)..";" elseif self.data.item then specstring = specstring..self.data.item..";" end @@ -1096,7 +1096,7 @@ smartfs.element("image", { ";".. self.data.size.w..","..self.data.size.h.. ";".. - self.data.value.. + minetest.formspec_escape(self.data.value).. "]" else return "image[".. @@ -1104,7 +1104,7 @@ smartfs.element("image", { ";".. self.data.size.w..","..self.data.size.h.. ";".. - self.data.value.. + minetest.formspec_escape(self.data.value).. "]" end end,