]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix absurdic scores for HFILTER_URL_ONLY
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Aug 2016 15:32:23 +0000 (16:32 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 31 Aug 2016 11:10:45 +0000 (12:10 +0100)
src/plugins/lua/hfilter.lua

index 1c359f19ed378ee510bee317ac7e411890ea9e2e..7db6eab5f7c3830b12ae3ee1aa5bc1965d88470a 100644 (file)
@@ -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)