[asterisk-commits] jrose: branch 12 r418650 - in /branches/12: ./ funcs/func_uri.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 15 12:45:55 CDT 2014


Author: jrose
Date: Tue Jul 15 12:45:49 2014
New Revision: 418650

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418650
Log:
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

Modified:
    branches/12/   (props changed)
    branches/12/funcs/func_uri.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/funcs/func_uri.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/funcs/func_uri.c?view=diff&rev=418650&r1=418649&r2=418650
==============================================================================
--- branches/12/funcs/func_uri.c (original)
+++ branches/12/funcs/func_uri.c Tue Jul 15 12:45:49 2014
@@ -76,8 +76,8 @@
 		     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 @@
 		     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);




More information about the asterisk-commits mailing list