mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
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
This commit is contained in:
@@ -254,7 +254,7 @@ local formspec_escapes = {
|
|||||||
}
|
}
|
||||||
function core.formspec_escape(text)
|
function core.formspec_escape(text)
|
||||||
-- Use explicit character set instead of dot here because it doubles the performance
|
-- 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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user