Skip to content

Commit

Permalink
Avoid borking the luacontroller if the code uses square brackets. Whe…
Browse files Browse the repository at this point in the history
…n the next stable MT is released, uncomment the formspec_escape call to take advantave of formspec escaping.
  • Loading branch information
Uberi committed Mar 15, 2013
1 parent 588e41c commit e121172
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mesecons_luacontroller/init.lua
Expand Up @@ -284,9 +284,13 @@ end
local reset_meta = function(pos, code, errmsg)
local meta = minetest.env:get_meta(pos)
code = code or "";
code = string.gsub(code, "%[", "(") -- would otherwise
code = string.gsub(code, "%]", ")") -- corrupt formspec
errmsg = errmsg or "";
errmsg = string.gsub(errmsg, "%[", "(") -- would otherwise
errmsg = string.gsub(errmsg, "%]", ")") -- corrupt formspec
--code = minetest.formspec_escape(code or "")
--errmsg = minetest.formspec_escape(errmsg or "")
meta:set_string("code", code)
meta:set_string("formspec", "size[10,8]"..
"background[-0.2,-0.25;10.4,8.75;jeija_luac_background.png]"..
Expand Down

0 comments on commit e121172

Please sign in to comment.