]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] Correct CSS duplicate property handling to use last declaration
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 12 Jan 2026 12:56:57 +0000 (12:56 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 12 Jan 2026 12:56:57 +0000 (12:56 +0000)
commitbc2831843db487d38cedf62978f0d0b0f2054d40
tree8fcf56a0a569e5c32a7f7e6a3ecaacfea8563c4d
parent67b5ec7663fd5f782e55b7b67194cd32416faa34
[Fix] Correct CSS duplicate property handling to use last declaration

Fix two bugs in CSS property handling that caused text to be incorrectly
marked as invisible:

1. Fixed isset() macro misuse in override_values() - was passing a bitmask
   instead of a bit index, causing the override to never find matching values

2. Changed add_rule() to call override_values() instead of merge_values()
   when duplicate properties with normal priority are encountered, ensuring
   later CSS declarations properly override earlier ones per CSS spec

This fixes an issue where HTML emails with duplicate color declarations
(e.g., "color:#FFFFFF;color:#232333") would have text incorrectly filtered
as invisible, since only the first color was being used.

Added test case for duplicate color property handling.
src/libserver/css/css_rule.cxx