From 4cc158043eb6183ecefed7abd93b579afbdfd7f6 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 28 Jan 2015 16:38:27 -0500 Subject: [PATCH] Improve CSS server-side cleaner Fixes #3040 --- UI/MailPartViewers/UIxMailPartHTMLViewer.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UI/MailPartViewers/UIxMailPartHTMLViewer.m b/UI/MailPartViewers/UIxMailPartHTMLViewer.m index a9c3b511f..ca41c7f62 100644 --- a/UI/MailPartViewers/UIxMailPartHTMLViewer.m +++ b/UI/MailPartViewers/UIxMailPartHTMLViewer.m @@ -455,6 +455,10 @@ static NSData* _sanitizeContent(NSData *theData) { if (*currentChar == '{') inCSSDeclaration = YES; + if (*currentChar == '}') + // CSS syntax error: ending declaration character while not in a CSS declaration. + // Ignore eveything from last CSS declaration. + start = currentChar + 1; else if (*currentChar == ',') hasEmbeddedCSS = NO; else if (!hasEmbeddedCSS)