save_variables: Check lowercase variable names

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
This commit is contained in:
Pedro Lamas
2025-01-31 11:00:16 +00:00
committed by KevinOConnor
parent 2c90c97ccd
commit 8a2de5f23e
3 changed files with 9 additions and 2 deletions

View File

@@ -36,6 +36,8 @@ class SaveVariables:
cmd_SAVE_VARIABLE_help = "Save arbitrary variables to disk"
def cmd_SAVE_VARIABLE(self, gcmd):
varname = gcmd.get('VARIABLE')
if (varname.lower() != varname):
raise gcmd.error("VARIABLE must not contain upper case")
value = gcmd.get('VALUE')
try:
value = ast.literal_eval(value)