Fixed WiFi Access Point Password Bug

Updated Network::getFormData() to properly read special characters (!#$, etc.) input into Access Point web page as part of password of SSID.
This commit is contained in:
Gregg 2021-01-09 08:09:50 -06:00
parent eae2037a33
commit 8d55d0a60e
1 changed files with 7 additions and 1 deletions

View File

@ -398,8 +398,14 @@ int Network::getFormValue(char *formData, const char *tag, char *value, int maxS
int len=0; // track length of value int len=0; // track length of value
while(*v!='\0' && *v!='&' && len<maxSize){ // copy the value until null, '&', or maxSize is reached while(*v!='\0' && *v!='&' && len<maxSize){ // copy the value until null, '&', or maxSize is reached
if(*v=='%'){ // this is an escaped character of form %XX
v++;
sscanf(v,"%2x",value++);
v+=2;
} else {
*value++=*v++;
}
len++; len++;
*value++=*v++;
} }
*value='\0'; // add terminating null *value='\0'; // add terminating null