]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Further fixes for white on white rule
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 8 Aug 2016 14:56:29 +0000 (15:56 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 8 Aug 2016 14:56:29 +0000 (15:56 +0100)
conf/metrics.conf
rules/html.lua
src/libserver/html.c

index 8fee470cc24eb8ff1de7fa885cec2d44da8ef97f..1af29d420015807eff1739072403642739765cb1 100644 (file)
@@ -361,7 +361,7 @@ metric {
 
     group "body" {
         symbol "R_WHITE_ON_WHITE" {
-            weight = 5.5;
+            weight = 4.0;
             description = "White color on white background in HTML messages";
         }
         symbol "HTML_SHORT_LINK_IMG_1" {
index 2a807d07e7f8d6d17e42bf893154c26ee16dccd6..e1fdb6b73b6d1312a2462b0e8cc4b7f0d4d1d0b4 100644 (file)
@@ -175,7 +175,7 @@ rspamd_config.R_WHITE_ON_WHITE = {
     local arg
 
     for _,p in ipairs(tp) do -- iterate over text parts array using `ipairs`
-      if p:is_html() then -- if the current part is html part
+      if p:is_html() and p:get_html() then -- if the current part is html part
         normal_len = p:get_length()
         local hc = p:get_html() -- we get HTML context
 
index 3fb17d4e66856df8fc895d5f4509f228d07e06e7..b121006bbe5c059dda2a35cc9f7761182bb23568 100644 (file)
@@ -1545,8 +1545,10 @@ rspamd_html_process_style (rspamd_mempool_t *pool, struct html_block *bl,
                                                rspamd_html_process_color (c, p - c, &bl->font_color);
                                                msg_debug_pool ("got color: %xd", bl->font_color.d.val);
                                        }
-                                       if (klen == 16 && g_ascii_strncasecmp (key,
-                                                       "background-color", 16) == 0) {
+                                       else if ((klen == 16 && g_ascii_strncasecmp (key,
+                                                       "background-color", 16) == 0) ||
+                                                       (klen == 10 && g_ascii_strncasecmp (key,
+                                                                       "background", 10) == 0)) {
 
                                                rspamd_html_process_color (c, p - c, &bl->background_color);
                                                msg_debug_pool ("got bgcolor: %xd", bl->background_color.d.val);