From edc7df54801ab3bf30f96ac5aad6ce11a102f6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Mon, 6 Jun 2022 18:32:28 +0200 Subject: [PATCH] core.formspec_escape: Restore backwards compat Support numbers as arguments by using `string.gsub(text, ...)` instead of `text:gsub(...)` which will coerce `text` to a string --- builtin/common/misc_helpers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua index d2356b505..467f18804 100644 --- a/builtin/common/misc_helpers.lua +++ b/builtin/common/misc_helpers.lua @@ -254,7 +254,7 @@ local formspec_escapes = { } function core.formspec_escape(text) -- Use explicit character set instead of dot here because it doubles the performance - return text and text:gsub("[\\%[%];,]", formspec_escapes) + return text and string.gsub(text, "[\\%[%];,]", formspec_escapes) end