From: Vsevolod Stakhov Date: Thu, 25 Aug 2016 15:32:23 +0000 (+0100) Subject: [Fix] Fix absurdic scores for HFILTER_URL_ONLY X-Git-Tag: 1.3.5~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4bd7ab427e3842a7fae32f299d56634e5987df42;p=rspamd.git [Fix] Fix absurdic scores for HFILTER_URL_ONLY --- diff --git a/src/plugins/lua/hfilter.lua b/src/plugins/lua/hfilter.lua index 1c359f19e..7db6eab5f 100644 --- a/src/plugins/lua/hfilter.lua +++ b/src/plugins/lua/hfilter.lua @@ -266,7 +266,9 @@ local function hfilter(task) if url_len > 0 and plen > 0 then local rel = url_len / plen if rel > 0.8 then - task:insert_result('HFILTER_URL_ONLY', (rel - 0.8) * 5.0) + local sc = (rel - 0.8) * 5.0 + if sc > 1.0 then sc = 1.0 end + task:insert_result('HFILTER_URL_ONLY', sc) local lines = html_text_part:get_lines_count() if lines > 0 and lines < 2 then task:insert_result('HFILTER_URL_ONELINE', 1.00)