diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index f959e3a0..05694832 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1786,12 +1786,15 @@ std::optional CConfigManager::handleAnimation(const std::string& co PANIM->second.overridden = true; PANIM->second.pValues = &PANIM->second; - // on/off - PANIM->second.internalEnabled = ARGS[1] == "1"; + // This helper casts strings like "1", "true", "off", "yes"... to int. + int64_t enabledInt = configStringToInt(ARGS[1]) == 1; - if (ARGS[1] != "0" && ARGS[1] != "1") + // Checking that the int is 1 or 0 because the helper can return integers out of range. + if (enabledInt != 0 && enabledInt != 1) return "invalid animation on/off state"; + PANIM->second.internalEnabled = configStringToInt(ARGS[1]) == 1; + if (PANIM->second.internalEnabled) { // speed if (isNumber(ARGS[2], true)) {