mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Wraps lowertext() to ensure proper stringification. (#82442)
## About The Pull Request Fixes #82440 This PR just creates a new macro, `LOWER_TEXT()` (yes the irony is not lost on me) to wrap around all calls of `lowertext()` and ensure that whatever we input into that proc will be stringified using the `"[]"` (or `tostring()` for the nerds) operator. very simple. I also added a linter to enforce this (and prevent all forms of regression) because I think that machines should do the menial work and we shouldn't expect maintainers to remember this, let me know if you disagree. if there is a time when it should be opted out for some reason, the linter does respect it if you wrap your input with the `UNLINT()` function.
This commit is contained in:
@@ -34,7 +34,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
return
|
||||
|
||||
#ifndef TESTING
|
||||
if (lowertext(hsrc_command) == "_debug") //disable the integrated byond vv in the client side debugging tools since it doesn't respect vv read protections
|
||||
if (LOWER_TEXT(hsrc_command) == "_debug") //disable the integrated byond vv in the client side debugging tools since it doesn't respect vv read protections
|
||||
return
|
||||
#endif
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
if (value == "Random")
|
||||
return icon('icons/effects/random_spawners.dmi', "questionmark")
|
||||
else
|
||||
return icon('icons/obj/clothing/glasses.dmi', "glasses_[lowertext(value)]")
|
||||
return icon('icons/obj/clothing/glasses.dmi', "glasses_[LOWER_TEXT(value)]")
|
||||
|
||||
/datum/preference/choiced/glasses/is_accessible(datum/preferences/preferences)
|
||||
if (!..(preferences))
|
||||
|
||||
@@ -180,4 +180,4 @@ GLOBAL_LIST_INIT(non_ruleset_antagonists, list(
|
||||
/// Serializes an antag name to be used for preferences UI
|
||||
/proc/serialize_antag_name(antag_name)
|
||||
// These are sent through CSS, so they need to be safe to use as class names.
|
||||
return lowertext(sanitize_css_class_name(antag_name))
|
||||
return LOWER_TEXT(sanitize_css_class_name(antag_name))
|
||||
|
||||
Reference in New Issue
Block a user