Fix config filename truncation

5.12.0m
* Fix configuration filename truncation when it contains spaces (#2484,
#2490)
This commit is contained in:
Theo Arends 2018-04-19 21:28:26 +02:00
parent b7ed866803
commit cb0305d2a3
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
* Add random window to timers (#2447)
* Add optional KNX IP Protocol Support (#2402)
* Fix compile error when using ESP/Arduino library v2.3.0 by reverting KNX async UDP library to default UDP library (#2488,#2492,#2493)
* Fix configuration filename truncation when it contains spaces (#2484, #2490)
*
* 5.12.0l
* Release rules up to 511 characters

View File

@ -1001,7 +1001,7 @@ void HandleBackupConfiguration()
WebServer->setContentLength(sizeof(buffer));
char attachment[100];
snprintf_P(attachment, sizeof(attachment), PSTR("attachment; filename=Config_%s_%s.dmp"), Settings.friendlyname[0], my_version);
snprintf_P(attachment, sizeof(attachment), PSTR("attachment; filename=Config_%s_%s.dmp"), SpaceToUnderscore(Settings.friendlyname[0]), my_version);
WebServer->sendHeader(F("Content-Disposition"), attachment);
WebServer->send(200, FPSTR(HDR_CTYPE_STREAM), "");
memcpy(buffer, &Settings, sizeof(buffer));