diff --git a/code/defines/global.dm b/code/defines/global.dm index 8a277246855..2a07025e951 100644 --- a/code/defines/global.dm +++ b/code/defines/global.dm @@ -189,7 +189,7 @@ var/const/MAX_MESSAGE_LEN = 1024 var/const/MAX_PAPER_MESSAGE_LEN = 3072 var/const/MAX_BOOK_MESSAGE_LEN = 9216 -var/const/MAX_NAME_LEN = 40 +var/const/MAX_NAME_LEN = 32 var/list/paper_blacklist = list("script","frame","iframe","input","button","a","embed","object") diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index 3b24ee2b277..91ef3de010f 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -371,7 +371,7 @@ text("[src.oddbutton ? "Yes" : "No" else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + t = copytext(sanitize(t), 1, MAX_NAME_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index ebd3c081fbc..92cc9281ef9 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -869,7 +869,7 @@ Auto Patrol: []"}, else if(istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + t = copytext(sanitize(t), 1, MAX_NAME_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index 44cfca6938a..ad4ee1528c1 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -400,7 +400,7 @@ del(src) else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + t = copytext(sanitize(t), 1, MAX_NAME_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) @@ -422,7 +422,7 @@ del(src) else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + t = copytext(sanitize(t), 1, MAX_NAME_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index a0cdfb5be6b..cc149ad015b 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -575,7 +575,7 @@ else if(istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + t = copytext(sanitize(t), 1, MAX_NAME_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 0beff7136cc..46905532dbf 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -761,7 +761,7 @@ Auto Patrol: []"}, else if(istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + t = copytext(sanitize(t), 1, MAX_NAME_LEN) if(!t) return if(!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index bb55e8f65f4..a04c9c2b188 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -246,7 +246,7 @@ if (authenticated) var/t1 = href_list["assign_target"] if(t1 == "Custom") - var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_MESSAGE_LEN) + var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_NAME_LEN) if(temp_t) t1 = temp_t else diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 3310a68b6f2..2df8cb6f5c8 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -732,7 +732,7 @@ Neutralize All Unidentified Life Signs: []
"}, if (istype(W, /obj/item/weapon/pen)) // you can rename turrets like bots! var/t = input(user, "Enter new turret name", src.name, src.finish_name) as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + t = copytext(sanitize(t), 1, MAX_NAME_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/magic/library.dm b/code/game/magic/library.dm index dee387c3a85..963a7eb16ac 100644 --- a/code/game/magic/library.dm +++ b/code/game/magic/library.dm @@ -126,7 +126,7 @@ O.loc = src update_icon() else if(istype(O, /obj/item/weapon/pen)) - var/newname = copytext(sanitize(input("What would you like to title this bookshelf?") as text|null),1,MAX_MESSAGE_LEN) + var/newname = copytext(sanitize(input("What would you like to title this bookshelf?") as text|null),1,MAX_NAME_LEN) if(!newname) return else diff --git a/code/game/objects/bodybag.dm b/code/game/objects/bodybag.dm index 55a56cd4fb0..cb8a2f6a088 100644 --- a/code/game/objects/bodybag.dm +++ b/code/game/objects/bodybag.dm @@ -48,7 +48,7 @@ return if (!in_range(src, user) && src.loc != user) return - t = copytext(sanitize(t),1,MAX_MESSAGE_LEN) + t = copytext(sanitize(t),1,MAX_NAME_LEN) if (t) src.name = "body bag - " src.name += t diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index b315578d2d0..2f31f953c12 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -62,7 +62,7 @@ name = "[name] ([str])" update_icon() if("Description") - var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN) + var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_MESSAGE_LEN) if(!str || !length(str)) usr << "\red Invalid text." return @@ -150,7 +150,7 @@ name = "[name] ([str])" update_icon() if("Description") - var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN) + var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_MESSAGE_LEN) if(!str || !length(str)) usr << "\red Invalid text." return