diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-18 14:16:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-18 14:16:42 +0100 |
commit | 41dbaa134df0ebd36d8b286dbcb2b8fc673e8e64 (patch) | |
tree | 3599051bc3d77e09f99b1fc464cc96da0d622313 /src/controller.c | |
parent | 06d1646a6b7dc7a0e2870e4570f9a1100134ad82 (diff) | |
download | rspamd-41dbaa134df0ebd36d8b286dbcb2b8fc673e8e64.tar.gz rspamd-41dbaa134df0ebd36d8b286dbcb2b8fc673e8e64.zip |
[Minor] Fix more legacy history issues
Issue: #2348
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/controller.c b/src/controller.c index 25774f267..a9b5ab991 100644 --- a/src/controller.c +++ b/src/controller.c @@ -1405,7 +1405,7 @@ rspamd_controller_handle_legacy_history ( ucl_object_fromdouble (0.0), "required_score", 0, false); } - syms = g_strsplit_set (row->symbols, ",", -1); + syms = g_strsplit_set (row->symbols, ", ", -1); if (syms) { guint nelts = g_strv_length (syms); @@ -1413,6 +1413,13 @@ rspamd_controller_handle_legacy_history ( ucl_object_reserve (syms_obj, nelts); for (guint j = 0; j < nelts; j++) { + g_strstrip (syms[j]); + + if (strlen (syms[j]) == 0) { + /* Empty garbadge */ + continue; + } + ucl_object_t *cur = ucl_object_typed_new (UCL_OBJECT); ucl_object_insert_key (cur, ucl_object_fromdouble (0.0), |