summaryrefslogtreecommitdiff
path: root/funcs
diff options
context:
space:
mode:
authorWalter Doekes <walter+asterisk@wjd.nu>2013-03-20 20:18:40 +0000
committerWalter Doekes <walter+asterisk@wjd.nu>2013-03-20 20:18:40 +0000
commit0b1e78cace32b7c4cedab9b36e79c8cc15fc4ac2 (patch)
tree9790f6f3cbb56b1140278eeb09401c27d710d4ed /funcs
parent7ed0b80d94100626ccdd4ddb19207486bf59710a (diff)
Minor cleanup in func_curl near hashcompat code.
Review: https://reviewboard.asterisk.org/r/2402/ ........ Merged revisions 383457 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_curl.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/funcs/func_curl.c b/funcs/func_curl.c
index 2305d3719..7291fa019 100644
--- a/funcs/func_curl.c
+++ b/funcs/func_curl.c
@@ -665,20 +665,11 @@ static int acf_curl_helper(struct ast_channel *chan, const char *cmd, char *info
int rowcount = 0;
while (fields && values && (piece = strsep(&remainder, "&"))) {
char *name = strsep(&piece, "=");
- /* Do this before the decode, because if something has encoded
- * a literal plus-sign, we don't want to translate that to a
- * space. */
- if (hashcompat == HASHCOMPAT_LEGACY) {
- if (piece) {
- ast_uri_decode(piece, ast_uri_http_legacy);
- }
- ast_uri_decode(name, ast_uri_http_legacy);
- } else {
- if (piece) {
- ast_uri_decode(piece, ast_uri_http);
- }
- ast_uri_decode(name, ast_uri_http);
+ struct ast_flags mode = (hashcompat == HASHCOMPAT_LEGACY ? ast_uri_http_legacy : ast_uri_http);
+ if (piece) {
+ ast_uri_decode(piece, mode);
}
+ ast_uri_decode(name, mode);
ast_str_append(&fields, 0, "%s%s", rowcount ? "," : "", ast_str_set_escapecommas(&escapebuf, 0, name, INT_MAX));
ast_str_append(&values, 0, "%s%s", rowcount ? "," : "", ast_str_set_escapecommas(&escapebuf, 0, S_OR(piece, ""), INT_MAX));
rowcount++;