]> source.dussan.org Git - rspamd.git/commitdiff
Fix get_words_count method to be called on the textpart and not on the mimepart 4992/head
authorroot <root@166-D916-JPEC-SH01.ad.aruba.it>
Tue, 28 May 2024 13:00:56 +0000 (15:00 +0200)
committerroot <root@166-D916-JPEC-SH01.ad.aruba.it>
Tue, 28 May 2024 13:00:56 +0000 (15:00 +0200)
lualib/lua_scanners/common.lua

index 11f5e1f87bd61818f5cacbcc703f8185ccfc8051..fa751f4f4782282d7bd75500a55c87db3dc06675 100644 (file)
@@ -459,7 +459,7 @@ local function check_parts_match(task, rule)
 
     -- check text_part has more words than text_part_min_words_check
     if rule.scan_text_mime and rule.text_part_min_words and p:is_text() and
-        p:get_words_count() >= tonumber(rule.text_part_min_words) then
+        p:get_text():get_words_count() >= tonumber(rule.text_part_min_words) then
       return true
     end