Skip to content

Commit

Permalink
core.formspec_escape: Restore backwards compat
Browse files Browse the repository at this point in the history
Support numbers as arguments by using `string.gsub(text, ...)` instead of `text:gsub(...)` which will coerce `text` to a string
  • Loading branch information
appgurueu committed Jun 6, 2022
1 parent 951604e commit edc7df5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/common/misc_helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit edc7df5

Please sign in to comment.