From 41dbaa134df0ebd36d8b286dbcb2b8fc673e8e64 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 18 Jul 2018 14:16:42 +0100 Subject: [PATCH] [Minor] Fix more legacy history issues Issue: #2348 --- src/controller.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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), -- 2.39.5