Fix NO VALID JSON regression from may 4th

Fix NO VALID JSON regression from may 4th (#12440)
This commit is contained in:
Theo Arends 2021-06-22 16:54:47 +02:00
parent 096f5606b6
commit 540574fe49
3 changed files with 11 additions and 3 deletions

View File

@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- ESP32 Webcam add boundary marker before sending mjpeg image (#12376)
- DDS238-2 wrong reactive power value (#12283)
- NO VALID JSON regression from may 4th (#12440)
## [Released]

View File

@ -107,6 +107,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
### Fixed
- DDS238-2 wrong reactive power value [#12283](https://github.com/arendst/Tasmota/issues/12283)
- ESP32 Webcam add boundary marker before sending mjpeg image [#12376](https://github.com/arendst/Tasmota/issues/12376)
- NO VALID JSON regression from may 4th [#12440](https://github.com/arendst/Tasmota/issues/12440)
### Noted
- ESP32 single core **tasmota32solo1.bin** binary can only be uploaded using the GUI as OTA upload will trigger the watchdog timer

View File

@ -512,7 +512,13 @@ bool RulesRuleMatch(uint8_t rule_set, String &event, String &rule, bool stop_all
//AddLog(LOG_LEVEL_DEBUG, PSTR("RUL-RM2: RulesRuleMatch |%s|"), buf.c_str());
buf.replace("\\"," "); // "Disable" any escaped control character
// Do not do below replace as it will replace escaped quote too.
// buf.replace("\\"," "); // "Disable" any escaped control character
buf.replace("\n"," n"); // "Disable" escaped control character
buf.replace("\t"," t"); // "Disable" escaped control character
buf.replace("\r"," r"); // "Disable" escaped control character
buf.replace("\f"," f"); // "Disable" escaped control character
buf.replace("\b"," b"); // "Disable" escaped control character
JsonParser parser((char*)buf.c_str());
JsonParserObject obj = parser.getRootObject();
if (!obj) {
@ -2139,8 +2145,8 @@ void CmndRule(void)
}
// we need to split the rule in chunks
rule = rule.substring(0, MAX_RULE_SIZE);
rule += F("...");
// rule = rule.substring(0, MAX_RULE_SIZE);
// rule += F("...");
}
Response_P(PSTR("{\"%s%d\":{\"State\":\"%s\",\"Once\":\"%s\",\"StopOnError\":\"%s\",\"Length\":%d,\"Free\":%d,\"Rules\":\"%s\"}}"),
XdrvMailbox.command, index, GetStateText(bitRead(Settings->rule_enabled, index -1)), GetStateText(bitRead(Settings->rule_once, index -1)),