From fbd7e43d5d26e6463f925bc12e4494a6c9dcbe3e Mon Sep 17 00:00:00 2001 From: Aleksandr Zharov Date: Fri, 16 Oct 2026 17:01:26 +0500 Subject: [PATCH] [Rules] Fix endless loop on unknown {...} in rules on ESP8266 In parse_string_commands() the branch without FEATURE_EXTENDED_STRING_FUNCTIONS masked '{' and '}' in the whole line instead of in replacement (regression from 4e191fc5b). The following line.replace() put the unmasked braces back, so get_next_inner_bracket() found them again and the loop never ended (SW watchdog / exception reset). Mask replacement, as before 4e191fc5b. Fixes #5653 Co-Authored-By: Claude Opus 5.5 --- src/src/ESPEasyCore/ESPEasyRules.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/src/ESPEasyCore/ESPEasyRules.cpp b/src/src/ESPEasyCore/ESPEasyRules.cpp index 1621ff53c..6c539e3c8 100644 --- a/src/src/ESPEasyCore/ESPEasyRules.cpp +++ b/src/src/ESPEasyCore/ESPEasyRules.cpp @@ -884,8 +884,8 @@ void parse_string_commands(String& line) { #if FEATURE_EXTENDED_STRING_FUNCTIONS hideMasked(replacement, mustReplaceMaskedChars); // apply #else // if FEATURE_EXTENDED_STRING_FUNCTIONS - line.replace('{', static_cast(0x02)); - line.replace('}', static_cast(0x03)); + replacement.replace('{', static_cast(0x02)); + replacement.replace('}', static_cast(0x03)); #endif // if FEATURE_EXTENDED_STRING_FUNCTIONS }