diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-25 16:32:23 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-25 16:32:23 +0100 |
commit | a9ba6158428a812fb6f1b68e08e478b6ee6ccad0 (patch) | |
tree | 2fb2400bd2746f9293dbd5c6e74a95272698f5fc /src | |
parent | c232b10ecd6fec981e061584399e7771aba389ad (diff) | |
download | rspamd-a9ba6158428a812fb6f1b68e08e478b6ee6ccad0.tar.gz rspamd-a9ba6158428a812fb6f1b68e08e478b6ee6ccad0.zip |
[Fix] Fix absurdic scores for HFILTER_URL_ONLY
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/hfilter.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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) |