mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 14:23:16 -04:00
Fix patterns
This commit is contained in:
parent
2c7af7fae2
commit
72cb7dbdb2
3 changed files with 3 additions and 3 deletions
|
@ -196,7 +196,7 @@ function creative.register_tab(name, title, items)
|
||||||
and fields.creative_filter then
|
and fields.creative_filter then
|
||||||
inv.start_i = 0
|
inv.start_i = 0
|
||||||
inv.filter = fields.creative_filter:sub(1, 128) -- truncate to a sane length
|
inv.filter = fields.creative_filter:sub(1, 128) -- truncate to a sane length
|
||||||
:gsub("[%z-\8\11-\31\127]", "") -- strip naughty control characters (keeps \t and \n)
|
:gsub("[%z\1-\8\11-\31\127]", "") -- strip naughty control characters (keeps \t and \n)
|
||||||
:lower() -- search is case insensitive
|
:lower() -- search is case insensitive
|
||||||
sfinv.set_player_inventory_formspec(player, context)
|
sfinv.set_player_inventory_formspec(player, context)
|
||||||
elseif not fields.quit then
|
elseif not fields.quit then
|
||||||
|
|
|
@ -179,7 +179,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
data.description = S("\"@1\" by @2", short_title, data.owner)
|
data.description = S("\"@1\" by @2", short_title, data.owner)
|
||||||
data.text = fields.text:sub(1, max_text_size)
|
data.text = fields.text:sub(1, max_text_size)
|
||||||
data.text = data.text:gsub("\r\n", "\n"):gsub("\r", "\n")
|
data.text = data.text:gsub("\r\n", "\n"):gsub("\r", "\n")
|
||||||
data.text = data.text:gsub("[%z-\8\11-\31\127]", "") -- strip naughty control characters (keeps \t and \n)
|
data.text = data.text:gsub("[%z\1-\8\11-\31\127]", "") -- strip naughty control characters (keeps \t and \n)
|
||||||
data.page = 1
|
data.page = 1
|
||||||
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)
|
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)
|
||||||
|
|
||||||
|
|
|
@ -348,7 +348,7 @@ local function on_receive_fields(player, fields)
|
||||||
elseif (fields.key_enter_field == "filter" or fields.search)
|
elseif (fields.key_enter_field == "filter" or fields.search)
|
||||||
and fields.filter then
|
and fields.filter then
|
||||||
local new = fields.filter:sub(1, 128) -- truncate to a sane length
|
local new = fields.filter:sub(1, 128) -- truncate to a sane length
|
||||||
:gsub("[%z-\8\11-\31\127]", "") -- strip naughty control characters (keeps \t and \n)
|
:gsub("[%z\1-\8\11-\31\127]", "") -- strip naughty control characters (keeps \t and \n)
|
||||||
:lower() -- search is case insensitive
|
:lower() -- search is case insensitive
|
||||||
if data.filter == new then
|
if data.filter == new then
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue