From 904d616645d39ca6c38271f7736dafa4d63e07f0 Mon Sep 17 00:00:00 2001 From: Sergeant-Steve <43524510+Sergeant-Steve@users.noreply.github.com> Date: Sun, 23 Sep 2018 23:56:02 +0100 Subject: [PATCH] Fixed critical griefing bug with long site names Added string length to site rename confirmation to prevent griefers changing a site name to a wall of text which pushes the rename and spectate buttons off the screen. --- resmon.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resmon.lua b/resmon.lua index a4d12db..b12538c 100644 --- a/resmon.lua +++ b/resmon.lua @@ -665,6 +665,9 @@ function resmon.on_click.YARM_rename_confirm(event) local old_name = player_data.renaming_site local new_name = player.gui.center.YARM_site_rename.new_name.text + + if string.len(new_name) > 50 then player.print('That name is too long, site names can be a maximum of 50 characters.') return end + --Sets the maximum site name to 50 Characters & prints an error to chat if over the limit local site = force_data.ore_sites[old_name] force_data.ore_sites[old_name] = nil