Răsfoiți Sursa

[web]add decode urlcode for settings page (post request)

balbekova 5 ani în urmă
părinte
comite
012e46b716

+ 1 - 0
modules/HTTP_Server/http_server.c

@@ -918,6 +918,7 @@ void HTTP_SetSettings(char *buf, uint16_t lenBuf)
     uint8_t valueLen = 0;
     const uint8_t len = MAX_WEB_PARAM_LEN;
     char value[MAX_WEB_PARAM_LEN];
+    char str[MAX_WEB_PARAM_LEN];
 
     (void)lenBuf;
 

+ 1 - 1
modules/HTTP_Server/my_ssl_server.c

@@ -1150,7 +1150,7 @@ void HTTP_SetSettings(char *buf, uint16_t lenBuf)
     uint8_t valueLen = 0;
     const uint8_t len = MAX_WEB_PARAM_LEN;
     char value[MAX_WEB_PARAM_LEN];
-   
+    char str[MAX_WEB_PARAM_LEN];
 
     (void)lenBuf;
 

+ 3 - 1
modules/HTTP_Server/web_params_api.h

@@ -40,8 +40,10 @@
 #define JSON_SET_PARAM(tag, set_param, buf) \
     do { \
         memset(value, 0, sizeof(value)); \
+        memset(str, 0, sizeof(str)); \
         if (GetParamValue(buf, tag, value, &valueLen)) { \
-            set_param(value); \
+            url_decode(str, sizeof(str), value); \
+            set_param(str); \
         } else { \
           if (strncmp(tag, "tn_enabled", sizeof(tag)) == 0  \
               || strncmp(tag, "ssh_enabled", sizeof(tag)) == 0 \