diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-10 15:38:35 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-10 15:38:35 +0000 |
commit | 6ca665c6cd3ca6f9e2d5c3068fd8453c3613bd77 (patch) | |
tree | 1b7d95bcfa87fdf8ce1b1da570f2670e1daa04f5 /funcs | |
parent | bb1b8fd1fdc872cd457ec48c66372f25a03c8f74 (diff) |
Merged revisions 246022 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r246022 | tilghman | 2010-02-10 09:36:57 -0600 (Wed, 10 Feb 2010) | 2 lines
Enable warnings on atypical conditions for the FILTER function (suggested by mmichelson on the -dev list).
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@246025 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_strings.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index a9effbfee..eef3b6bf9 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -443,6 +443,10 @@ static int filter(struct ast_channel *chan, const char *cmd, char *parse, char * return -1; } + if (args.allowed[0] == '"' && !ast_opt_dont_warn) { + ast_log(LOG_WARNING, "FILTER allowed characters includes the quote (\") character. This may not be what you want.\n"); + } + /* Expand ranges */ for (; *(args.allowed) && allowedlen < sizeof(allowed); ) { char c1 = 0, c2 = 0; @@ -457,6 +461,10 @@ static int filter(struct ast_channel *chan, const char *cmd, char *parse, char * c2 = -1; args.allowed += consumed + 1; + if ((c2 < c1 || c2 == -1) && !ast_opt_dont_warn) { + ast_log(LOG_WARNING, "Range wrapping in FILTER(%s,%s). This may not be what you want.\n", parse, args.string); + } + /*!\note * Looks a little strange, until you realize that we can overflow * the size of a char. |