aboutsummaryrefslogtreecommitdiff
path: root/builtin/common
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2022-06-06 18:32:28 +0200
committerGitHub <noreply@github.com>2022-06-06 18:32:28 +0200
commitedc7df54801ab3bf30f96ac5aad6ce11a102f6b9 (patch)
tree269a904645d70ae3d284535930e6588b6e4f4076 /builtin/common
parent951604e29ff9d4b796003264574e06031c014a3f (diff)
downloadminetest-edc7df54801ab3bf30f96ac5aad6ce11a102f6b9.tar.gz
minetest-edc7df54801ab3bf30f96ac5aad6ce11a102f6b9.tar.bz2
minetest-edc7df54801ab3bf30f96ac5aad6ce11a102f6b9.zip
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
Diffstat (limited to 'builtin/common')
-rw-r--r--builtin/common/misc_helpers.lua2
1 files changed, 1 insertions, 1 deletions
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