Skip to content

Commit

Permalink
Fixed settings page broken by using "%" in input fields (fixes Aircoo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Jun 30, 2021
1 parent 8b6cc70 commit 7483d3b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions wled00/xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7483d3b

Please sign in to comment.