diff --git a/CHANGELOG.md b/CHANGELOG.md index 88ced99c..c53f4e74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ### Builds after release 0.12.0 +#### Build 2106302 + +- Fixed settings page broken by using "%" in input fields + #### Build 2106301 - Fixed a problem with disabled buttons reverting to pin 0 causing conflict diff --git a/wled00/wled.h b/wled00/wled.h index 2bcfa6b6..662f84b0 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2106301 +#define VERSION 2106302 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG diff --git a/wled00/xml.cpp b/wled00/xml.cpp index c12991fe..aef0ec29 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -158,13 +158,24 @@ void sappends(char stype, const char* key, char* val) { switch(stype) { - case 's': //string (we can interpret val as char*) + case 's': { //string (we can interpret val as char*) oappend("d.Sf."); oappend(key); oappend(".value=\""); - oappend(val); + //convert "%" to "%%" to make EspAsyncWebServer happy + char buf[130]; + uint8_t len = strlen(val) +1; + uint8_t s = 0; + for (uint8_t i = 0; i < len; i++) { + buf[i+s] = val[i]; + if (val[i] == '%') { + s++; buf[i+s] = '%'; + } + } + + oappend(buf); oappend("\";"); - break; + break; } case 'm': //message oappend(SET_F("d.getElementsByClassName")); oappend(key);