Skip to content

Commit 89af312

Browse files
authored
Merge pull request tzapu#398 from Derek123456/Derek123456-patch-1
Fix for issue tzapu#392 closes tzapu#392 thank you very much
2 parents f9c4c87 + 68e32a1 commit 89af312

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

WiFiManager.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ void WiFiManager::handleWifi(boolean scan) {
485485
}
486486

487487
page += FPSTR(HTTP_FORM_START);
488-
char parLength[2];
488+
char parLength[5];
489489
// add the extra parameters to the form
490490
for (int i = 0; i < _paramsCount; i++) {
491491
if (_params[i] == NULL) {
@@ -497,7 +497,7 @@ void WiFiManager::handleWifi(boolean scan) {
497497
pitem.replace("{i}", _params[i]->getID());
498498
pitem.replace("{n}", _params[i]->getID());
499499
pitem.replace("{p}", _params[i]->getPlaceholder());
500-
snprintf(parLength, 2, "%d", _params[i]->getValueLength());
500+
snprintf(parLength, 5, "%d", _params[i]->getValueLength());
501501
pitem.replace("{l}", parLength);
502502
pitem.replace("{v}", _params[i]->getValue());
503503
pitem.replace("{c}", _params[i]->getCustomHTML());

WiFiManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const char HTTP_HEAD_END[] PROGMEM = "</head><body><div style='text-align
2929
const char HTTP_PORTAL_OPTIONS[] PROGMEM = "<form action=\"/wifi\" method=\"get\"><button>Configure WiFi</button></form><br/><form action=\"/0wifi\" method=\"get\"><button>Configure WiFi (No Scan)</button></form><br/><form action=\"/i\" method=\"get\"><button>Info</button></form><br/><form action=\"/r\" method=\"post\"><button>Reset</button></form>";
3030
const char HTTP_ITEM[] PROGMEM = "<div><a href='#p' onclick='c(this)'>{v}</a>&nbsp;<span class='q {i}'>{r}%</span></div>";
3131
const char HTTP_FORM_START[] PROGMEM = "<form method='get' action='wifisave'><input id='s' name='s' length=32 placeholder='SSID'><br/><input id='p' name='p' length=64 type='password' placeholder='password'><br/>";
32-
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}' name='{n}' length={l} placeholder='{p}' value='{v}' {c}>";
32+
const char HTTP_FORM_PARAM[] PROGMEM = "<br/><input id='{i}' name='{n}' maxlength={l} placeholder='{p}' value='{v}' {c}>";
3333
const char HTTP_FORM_END[] PROGMEM = "<br/><button type='submit'>save</button></form>";
3434
const char HTTP_SCAN_LINK[] PROGMEM = "<br/><div class=\"c\"><a href=\"/wifi\">Scan</a></div>";
3535
const char HTTP_SAVED[] PROGMEM = "<div>Credentials Saved<br />Trying to connect ESP to network.<br />If it fails reconnect to AP to try again</div>";

0 commit comments

Comments
 (0)