From 4bd7ab427e3842a7fae32f299d56634e5987df42 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 25 Aug 2016 16:32:23 +0100 Subject: [PATCH] [Fix] Fix absurdic scores for HFILTER_URL_ONLY --- src/plugins/lua/hfilter.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.5