From 412b1c3e558fcd8932370ec10144e215a544ef97 Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Fri, 13 Jul 2012 12:42:41 -0700 Subject: [PATCH] Tighten up cssfilter bg-gradient regex to prevent inner rules. Thanks to listen2 for disclosing this issue. --- r2/r2/lib/cssfilter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r2/r2/lib/cssfilter.py b/r2/r2/lib/cssfilter.py index 20c27f02f..a5adcd431 100644 --- a/r2/r2/lib/cssfilter.py +++ b/r2/r2/lib/cssfilter.py @@ -66,7 +66,7 @@ custom_macros = { 'csscolor': r'(maroon|red|orange|yellow|olive|purple|fuchsia|white|lime|green|navy|blue|aqua|teal|black|silver|gray|ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText)|#[0-9a-f]{3}|#[0-9a-f]{6}|rgb\({w}{int}{w},{w}{int}{w},{w}{int}{w}\)|rgb\({w}{num}%{w},{w}{num}%{w},{w}{num}%{w}\)', 'color': '{x11color}|{csscolor}', - 'bg-gradient': r'none|{color}|[a-z-]*-gradient\(.*\)', + 'bg-gradient': r'none|{color}|[a-z-]*-gradient\([^;]*\)', 'bg-gradients': r'{bg-gradient}(?:,\s*{bg-gradient})*', 'border-radius': r'(({length}|{percentage}){w}){1,2}',