diff options
author | Jonathan Rose <jrose@digium.com> | 2014-07-15 17:57:17 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2014-07-15 17:57:17 +0000 |
commit | 4420ce6e5c84f4bb091bb1877dd1158feff2f1c8 (patch) | |
tree | c7d42e11cbe9412ff30dadc0b4c64875f95bf07a /funcs | |
parent | a1eec851c63ef9fde880cd6b72bf52bf745d6c6b (diff) |
func_uri: URIENCODE/URIDECODE - allow empty strings as argument
Previously these two dialplan functions would issue warnings and
return failure when an empty string is used as the argument. Now
they will not issue a warning and will successfully return an
empty string.
ASTERISK-23911 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3745/
........
Merged revisions 418641 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 418649 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 418650 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_uri.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/funcs/func_uri.c b/funcs/func_uri.c index f4ecf3d67..f53b75fa3 100644 --- a/funcs/func_uri.c +++ b/funcs/func_uri.c @@ -76,8 +76,8 @@ static int uriencode(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { if (ast_strlen_zero(data)) { - ast_log(LOG_WARNING, "Syntax: URIENCODE(<data>) - missing argument!\n"); - return -1; + buf[0] = '\0'; + return 0; } ast_uri_encode(data, buf, len, ast_uri_http); @@ -90,8 +90,8 @@ static int uridecode(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { if (ast_strlen_zero(data)) { - ast_log(LOG_WARNING, "Syntax: URIDECODE(<data>) - missing argument!\n"); - return -1; + buf[0] = '\0'; + return 0; } ast_copy_string(buf, data, len); |