mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
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 🆑 fix: items such as dna injectors and others that have strange characters in their names can now be dispensed from custom vending machines /🆑
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user