mirror of
				https://github.com/luanti-org/minetest_game.git
				synced 2025-10-31 07:35:22 +01:00 
			
		
		
		
	Truncate to a saner length
This commit is contained in:
		| @@ -195,7 +195,7 @@ function creative.register_tab(name, title, items) | ||||
| 					fields.key_enter_field == "creative_filter") | ||||
| 					and fields.creative_filter then | ||||
| 				inv.start_i = 0 | ||||
| 				inv.filter = fields.creative_filter:sub(1, 1e3) -- 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) | ||||
| 						:lower() -- search is case insensitive | ||||
| 				sfinv.set_player_inventory_formspec(player, context) | ||||
|   | ||||
| @@ -347,7 +347,7 @@ local function on_receive_fields(player, fields) | ||||
|  | ||||
| 	elseif (fields.key_enter_field == "filter" or fields.search) | ||||
| 			and fields.filter then | ||||
| 		local new = fields.filter:sub(1, 1e3) -- 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) | ||||
| 				:lower() -- search is case insensitive | ||||
| 		if data.filter == new then | ||||
|   | ||||
		Reference in New Issue
	
	Block a user