From bca655ffdd411d1bb18aeaf570983e8f3f47a7cb Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 17 Jan 2018 13:58:42 -0500 Subject: [PATCH] (css) Fix server-side CSS cleaner Fixes #4366 --- NEWS | 1 + UI/MailPartViewers/UIxMailPartHTMLViewer.m | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index eb45292a48..f765d5eca3 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,7 @@ Bug fixes - [web] removed null characters from JSON responses - [web] fixed advanced mailbox search when mailbox name is very long - [web] fixed handling of public access rights of Calendars (#4344) + - [web] fixed server-side CSS sanitization of messages (#4366) - [eas] hebrew folders encoding problem using EAS (#4240) - [eas] avoid sync requests for shared folders every second (#4275) diff --git a/UI/MailPartViewers/UIxMailPartHTMLViewer.m b/UI/MailPartViewers/UIxMailPartHTMLViewer.m index 1601894a7a..060d25db02 100644 --- a/UI/MailPartViewers/UIxMailPartHTMLViewer.m +++ b/UI/MailPartViewers/UIxMailPartHTMLViewer.m @@ -288,8 +288,8 @@ - (void) _appendStyle: (unichar *) _chars } else { - // Prefix CSS rule - length = (currentChar - start); + // Prefix CSS rule including ending curly bracket + length = (currentChar - start) + 1; [declaration appendString: [NSString stringWithCharacters: start length: length]]; [css appendFormat: @".SOGoHTMLMail-CSS-Delimiter %@\n", declaration]; start = currentChar;