From 086e781b8fca06be331bc36eb91ebefe33a24a1c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 22 Jun 2018 14:16:20 +0200 Subject: Fix bug where some HTML comments could have been malformed by HTML parser (#6333) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_washtml.php | 6 +++--- tests/Framework/Washtml.php | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0374c3685..68fa8b349 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -98,6 +98,7 @@ CHANGELOG Roundcube Webmail - Fix bug where unicode contact names could have been broken/emptied or caused DB errors (#6299) - Fix bug where after "mark all folders as read" action message counters were not reset (#6307) - Enigma: [EFAIL] Don't decrypt PGP messages with no MDC protection (#6289) +- Fix bug where some HTML comments could have been malformed by HTML parser (#6333) RELEASE 1.3.6 ------------- diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php index fff1f44e8..856027265 100644 --- a/program/lib/Roundcube/rcube_washtml.php +++ b/program/lib/Roundcube/rcube_washtml.php @@ -660,9 +660,9 @@ class rcube_washtml $html = preg_replace_callback('/(<(?!\!)[\/]*)([^\s>]+)([^>]*)/', array($this, 'html_tag_callback'), $html); // Remove invalid HTML comments (#1487759) - // Don't remove valid conditional comments - // Don't remove MSOutlook () conditional comments (#1489004) - $html = preg_replace('/) + $html = preg_replace('/

para2

"; + $washed = $this->cleanupResult($washer->wash($html)); + + $this->assertEquals('

para1

para2

', $washed, "HTML comments - bracket inside"); } /** -- cgit v1.2.3