From db5e36e7b433031b17c5b3dbea5ac5eba99bb07b Mon Sep 17 00:00:00 2001 From: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Date: Fri, 28 Nov 2025 17:49:09 +0530 Subject: [PATCH] Fixes custom vendor not sanitizing item names (#94191) ## About The Pull Request - Fixes https://github.com/tgstation/tgstation/pull/91987#issuecomment-3573314355 Strings such as `\improper` and other non alphanumeric characters that are stripped out when sent to the UI are now discarded so we don't end up with malformed hashes ## Changelog :cl: fix: items such as dna injectors and others that have strange characters in their names can now be dispensed from custom vending machines /:cl: --- code/modules/vending/custom.dm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/modules/vending/custom.dm b/code/modules/vending/custom.dm index 53ad1209bcf..27b760d887c 100644 --- a/code/modules/vending/custom.dm +++ b/code/modules/vending/custom.dm @@ -1,5 +1,5 @@ -///This unique key decides how items are stacked on the UI. We separate them based on name,price & type -#define ITEM_HASH(item)("[item.name][item.custom_price][item.type]") +///This unique key decides how items are stacked on the UI. We separate them based on name, price & type +#define ITEM_HASH(item)(sanitize_css_class_name("[item.name][item.custom_price][item.type]")) /obj/machinery/vending/custom name = "Custom Vendor" @@ -275,8 +275,6 @@ if(ITEM_HASH(product) == dispensed_item) dispensed_item = product break - if(QDELETED(dispensed_item)) - return var/obj/item/card/id/id_card = user.get_idcard(TRUE) if(QDELETED(id_card))