From: Andrew Lewis Date: Wed, 29 Mar 2017 13:45:40 +0000 (+0200) Subject: [Fix] Add missing score normalisation for HFILTER_URL_ONLY X-Git-Tag: 1.5.5~88 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ab14fef3b08555927d9b1e0c501cce0f0720f626;p=rspamd.git [Fix] Add missing score normalisation for HFILTER_URL_ONLY - Issue: #1565 - Reported by: @moisseev --- diff --git a/src/plugins/lua/hfilter.lua b/src/plugins/lua/hfilter.lua index 69fa09e4f..80d289d45 100644 --- a/src/plugins/lua/hfilter.lua +++ b/src/plugins/lua/hfilter.lua @@ -292,8 +292,9 @@ local function hfilter(task) if plen > 0 and url_len > 0 then local rel = url_len / plen if rel > 0.8 then - task:insert_result('HFILTER_URL_ONLY', (rel - 0.8) * 5.0, - tostring(rel)) + local sc = (rel - 0.8) * 5.0 + if sc > 1.0 then sc = 1.0 end + task:insert_result('HFILTER_URL_ONLY', sc, tostring(sc)) local lines = plain_text_part:get_lines_count() if lines > 0 and lines < 2 then task:insert_result('HFILTER_URL_ONELINE', 1.00,