diff options
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_curl.c | 18 | ||||
-rw-r--r-- | funcs/func_uri.c | 4 |
2 files changed, 7 insertions, 15 deletions
diff --git a/funcs/func_curl.c b/funcs/func_curl.c index 0795944ca..e5784652f 100644 --- a/funcs/func_curl.c +++ b/funcs/func_curl.c @@ -658,20 +658,12 @@ static int acf_curl_helper(struct ast_channel *chan, const char *cmd, char *info * a literal plus-sign, we don't want to translate that to a * space. */ if (hashcompat == HASHCOMPAT_LEGACY) { - int i; - for (i = 0; name[i]; i++) { - if (name[i] == '+') { - name[i] = ' '; - } - } - for (i = 0; piece[i]; i++) { - if (piece[i] == '+') { - piece[i] = ' '; - } - } + ast_uri_decode(piece, ast_uri_http_legacy); + ast_uri_decode(name, ast_uri_http_legacy); + } else { + ast_uri_decode(piece, ast_uri_http); + ast_uri_decode(name, ast_uri_http); } - ast_uri_decode(piece); - ast_uri_decode(name); ast_str_append(&fields, 0, "%s%s", rowcount ? "," : "", name); ast_str_append(&values, 0, "%s%s", rowcount ? "," : "", piece); rowcount++; diff --git a/funcs/func_uri.c b/funcs/func_uri.c index 5efa6ea38..ecf23d8ff 100644 --- a/funcs/func_uri.c +++ b/funcs/func_uri.c @@ -76,7 +76,7 @@ static int uriencode(struct ast_channel *chan, const char *cmd, char *data, return -1; } - ast_uri_encode(data, buf, len, 1); + ast_uri_encode(data, buf, len, ast_uri_http); return 0; } @@ -91,7 +91,7 @@ static int uridecode(struct ast_channel *chan, const char *cmd, char *data, } ast_copy_string(buf, data, len); - ast_uri_decode(buf); + ast_uri_decode(buf, ast_uri_http); return 0; } |