Fix URI decode issue for feedback module

This commit is contained in:
2019-04-29 09:08:18 +02:00
parent e623c0dce1
commit 08e771eaa0
3 changed files with 38 additions and 4 deletions
+12 -4
View File
@@ -59,17 +59,25 @@ on_input_var( const char *key, uint32_t k_len,
{
Context ctx = (Context) p_ctx;
AxFeedback mod = (AxFeedback)((AxContext)ctx)->mod;
char **out = NULL;
if (!ctx->email && k_len == mod->name_email_length) {
if (strncmp(key, mod->name_email, k_len)==0)
return (cstuff_strncpy(&ctx->email, val, v_len) == -1);
if (strncmp(key, mod->name_email, k_len) == 0) {
out = &ctx->email;
}
}
if (!ctx->msg && k_len == mod->name_msg_length) {
if (strncmp(key, mod->name_msg, k_len)==0)
return (cstuff_strncpy(&ctx->msg, val, v_len) == -1);
if (strncmp(key, mod->name_msg, k_len)==0) {
out = &ctx->msg;
}
}
if (out) {
if (cstuff_strncpy(out, val, v_len) == -1)
return -1;
ax_query__decode(*out);
}
return 0;
}