From 05c186a485f9b07680f6cb1d0e44039a37a400bf Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 2 Aug 2022 21:17:20 +0100 Subject: [PATCH] [Minor] Consider subject when checking hash function input length --- lualib/lua_fuzzy.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lualib/lua_fuzzy.lua b/lualib/lua_fuzzy.lua index ce4ac55ee..332e828ac 100644 --- a/lualib/lua_fuzzy.lua +++ b/lualib/lua_fuzzy.lua @@ -131,6 +131,13 @@ local function check_length(task, part, rule) -- However, in the case of empty parts this method returns `nil`, so extra -- sanity check is required. bytes = #(part:get_text():get_content_oneline() or '') + + -- Short hashing algorithm also use subject unless explicitly denied + if not rule.no_subject then + local subject = task:get_subject() or '' + bytes = bytes + #subject + end + if rule.text_multiplier then adjusted_bytes = bytes * rule.text_multiplier end -- 2.39.5