]> source.dussan.org Git - rspamd.git/commitdiff
* Fix order of functions arguments
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 31 Mar 2009 09:29:11 +0000 (13:29 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 31 Mar 2009 09:29:11 +0000 (13:29 +0400)
* Do not try to check non-regexp expressions

src/expressions.c
src/plugins/regexp.c

index c028d84761e10a5f277542ffee32945256adde88..e09b33ea1dfceb019638921b09451783d4521ffa 100644 (file)
@@ -402,12 +402,12 @@ parse_expression (memory_pool_t *pool, char *line)
                                                        g_strstrip (str);
                                                        arg->type = EXPRESSION_ARGUMENT_NORMAL;
                                                        arg->data = str;
-                                                       func->args = g_list_prepend (func->args, arg);
+                                                       func->args = g_list_append (func->args, arg);
                                                }
                                                else {
                                                        arg->type = EXPRESSION_ARGUMENT_FUNCTION;
                                                        arg->data = old;
-                                                       func->args = g_list_prepend (func->args, arg);
+                                                       func->args = g_list_append (func->args, arg);
                                                }
                                                /* Pop function */
                                                if (*p == ')') {
index 6f6efd4be8476fa0c8145c672f13f75a4aa2133a..8dadffcf1d3f0cec3ae5bd05ec4a77347366faee 100644 (file)
@@ -412,6 +412,11 @@ rspamd_regexp_match_number (struct worker_task *task, GList *args)
                }
                else {
                        param_pattern = (char *)arg->data;
+                       if (*param_pattern != '/') {
+                               /* Skip non-regexp arguments */
+                               cur = g_list_next (cur);
+                               continue;
+                       }
                        /* This is regexp, so compile and create g_regexp object */
                        if ((re = re_cache_check (param_pattern)) == NULL) {
                                re = parse_regexp (task->task_pool, param_pattern);