Skip to content

Commit

Permalink
Fixed HTML text box length for controller settings - Issue #453 (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
JK-de authored and psy0rz committed Jul 29, 2017
1 parent e09f5ca commit 5aef196
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/WebServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ void handle_controllers() {

if (ControllerSettings.UseDNS)
{
addFormTextBox(reply, F("Controller Hostname"), F("controllerhostname"), ControllerSettings.HostName, 64);
addFormTextBox(reply, F("Controller Hostname"), F("controllerhostname"), ControllerSettings.HostName, sizeof(ControllerSettings.HostName)-1);
}
else
{
Expand All @@ -877,22 +877,22 @@ void handle_controllers() {
byte ProtocolIndex = getProtocolIndex(Settings.Protocol[index - 1]);
if (Protocol[ProtocolIndex].usesAccount)
{
addFormTextBox(reply, F("Controller User"), F("controlleruser"), SecuritySettings.ControllerUser[index - 1], 26);
addFormTextBox(reply, F("Controller User"), F("controlleruser"), SecuritySettings.ControllerUser[index - 1], sizeof(SecuritySettings.ControllerUser[0])-1);
}

if (Protocol[ProtocolIndex].usesPassword)
{
addFormPasswordBox(reply, F("Controller Password"), F("controllerpassword"), SecuritySettings.ControllerPassword[index - 1], 64);
addFormPasswordBox(reply, F("Controller Password"), F("controllerpassword"), SecuritySettings.ControllerPassword[index - 1], sizeof(SecuritySettings.ControllerPassword[0])-1);
}

if (Protocol[ProtocolIndex].usesTemplate || Protocol[ProtocolIndex].usesMQTT)
{
addFormTextBox(reply, F("Controller Subscribe"), F("controllersubscribe"), ControllerSettings.Subscribe, 64);
addFormTextBox(reply, F("Controller Subscribe"), F("controllersubscribe"), ControllerSettings.Subscribe, sizeof(ControllerSettings.Subscribe)-1);
}

if (Protocol[ProtocolIndex].usesTemplate || Protocol[ProtocolIndex].usesMQTT)
{
addFormTextBox(reply, F("Controller Publish"), F("controllerpublish"), ControllerSettings.Publish, 64);
addFormTextBox(reply, F("Controller Publish"), F("controllerpublish"), ControllerSettings.Publish, sizeof(ControllerSettings.Publish)-1);
}

addFormCheckBox(reply, F("Enabled"), F("controllerenabled"), Settings.ControllerEnabled[index - 1]);
Expand Down

0 comments on commit 5aef196

Please sign in to comment.