diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-08 15:56:29 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-08 15:56:29 +0100 |
commit | fd24c961ae6ed53edc14e34991a8e5f603307596 (patch) | |
tree | e168ebbb9735fc5289aa7ff0161f657f0168470a | |
parent | d4dd679a8cba673e6d0beb2766380940325704ce (diff) | |
download | rspamd-fd24c961ae6ed53edc14e34991a8e5f603307596.tar.gz rspamd-fd24c961ae6ed53edc14e34991a8e5f603307596.zip |
[Fix] Further fixes for white on white rule
-rw-r--r-- | conf/metrics.conf | 2 | ||||
-rw-r--r-- | rules/html.lua | 2 | ||||
-rw-r--r-- | src/libserver/html.c | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/conf/metrics.conf b/conf/metrics.conf index 8fee470cc..1af29d420 100644 --- a/conf/metrics.conf +++ b/conf/metrics.conf @@ -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" { diff --git a/rules/html.lua b/rules/html.lua index 2a807d07e..e1fdb6b73 100644 --- a/rules/html.lua +++ b/rules/html.lua @@ -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 diff --git a/src/libserver/html.c b/src/libserver/html.c index 3fb17d4e6..b121006bb 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -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); |