]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 246022 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 10 Feb 2010 15:38:27 +0000 (15:38 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 10 Feb 2010 15:38:27 +0000 (15:38 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@246024 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_strings.c

index 29fc6bdd37f9cd30cffee9d53746876b2ccb61eb..ce54cd85f89bd8edff9d98ffb002d2f0e1fefc36 100644 (file)
@@ -99,6 +99,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;
@@ -113,6 +117,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.