Browse Source

[Fix] Further fixes for white on white rule

tags/1.3.2
Vsevolod Stakhov 7 years ago
parent
commit
fd24c961ae
3 changed files with 6 additions and 4 deletions
  1. 1
    1
      conf/metrics.conf
  2. 1
    1
      rules/html.lua
  3. 4
    2
      src/libserver/html.c

+ 1
- 1
conf/metrics.conf View 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" {

+ 1
- 1
rules/html.lua View 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


+ 4
- 2
src/libserver/html.c View 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);

Loading…
Cancel
Save