aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-10 15:36:57 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-10 15:36:57 +0000
commit17232f53135162cab6a3309f37597ee2d11a9aad (patch)
treed1b69a5cdc569d39716c8af3b433d50a111dfa0a /funcs
parentc6b5b251fdc825307ee0016358bd39fafc2d1659 (diff)
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/trunk@246022 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_strings.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index 34bff1e55..faf0ce2b2 100644
--- a/funcs/func_strings.c
+++ b/funcs/func_strings.c
@@ -603,6 +603,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;
@@ -617,6 +621,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.