formspec_escape stability improvement
* formspec_escape causes server crash, when text argument is a number. the `tostring(text)` prevents this * backported https://github.com/MultiCraft/MultiCraft/pull/87
This commit is contained in:
parent
ce35eb4122
commit
17cb07a366
@ -254,6 +254,7 @@ end
|
||||
|
||||
|
||||
function core.formspec_escape(text)
|
||||
text = tostring(text)
|
||||
if text ~= nil then
|
||||
text = text:gsub("\\", "\\\\")
|
||||
text = text:gsub("%]", "\\]")
|
||||
|
Loading…
x
Reference in New Issue
Block a user