From e5033a927a839e15851aac833ccf74cefa4fc4c9 Mon Sep 17 00:00:00 2001 From: Mark van Alphen Date: Mon, 22 Apr 2019 00:55:54 +0200 Subject: [PATCH] Fix toggle sanization --- code/__DEFINES/preferences.dm | 2 ++ code/modules/client/preference/preferences_mysql.dm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index 1f2bc9d8240..32433975e9e 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -32,6 +32,8 @@ #define TYPING_ONCE 1048576 #define AMBIENT_OCCLUSION 2097152 +#define TOGGLES_TOTAL 4194304 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined. + #define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_LOOC|MEMBER_PUBLIC|DONATOR_PUBLIC|AMBIENT_OCCLUSION) // Admin attack logs filter system, see /proc/add_attack_logs and /proc/msg_admin_attack diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm index 0628276ccbc..3483a4c77d3 100644 --- a/code/modules/client/preference/preferences_mysql.dm +++ b/code/modules/client/preference/preferences_mysql.dm @@ -55,7 +55,7 @@ ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor)) UI_style = sanitize_inlist(UI_style, list("White", "Midnight"), initial(UI_style)) default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot)) - toggles = sanitize_integer(toggles, 0, 2097151, initial(toggles)) + toggles = sanitize_integer(toggles, 0, TOGGLES_TOTAL, initial(toggles)) sound = sanitize_integer(sound, 0, 65535, initial(sound)) UI_style_color = sanitize_hexcolor(UI_style_color, initial(UI_style_color)) UI_style_alpha = sanitize_integer(UI_style_alpha, 0, 255, initial(UI_style_alpha))