From 8aa8baed57d1e55d922fcd6902e514224dd41b3c Mon Sep 17 00:00:00 2001 From: Seth Scherer Date: Tue, 14 Jun 2022 01:35:03 -0400 Subject: [PATCH] Limits pill names to 42 characters (#67744) --- code/modules/plumbing/plumbers/pill_press.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/modules/plumbing/plumbers/pill_press.dm b/code/modules/plumbing/plumbers/pill_press.dm index 94028b9f177..409ceb58247 100644 --- a/code/modules/plumbing/plumbers/pill_press.dm +++ b/code/modules/plumbing/plumbers/pill_press.dm @@ -136,7 +136,11 @@ if("change_current_volume") current_volume = clamp(text2num(params["volume"]), min_volume, max_volume) if("change_product_name") - product_name = html_encode(params["name"]) + var/formatted_name = html_encode(params["name"]) + if (length(formatted_name) > MAX_NAME_LEN) + product_name = copytext(formatted_name, 1, MAX_NAME_LEN+1) + else + product_name = formatted_name if("change_product") product = params["product"] if (product == "pill")