summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--program/lib/washtml.php4
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d13a99a79..c827c0b61 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix handling of invalid HTML comments in messages (#1487759)
- Fix parsing FETCH response for very long headers (#1487753)
- Fix add/remove columns in message list when message_sort_order isn't set (#1487751)
- Check mime headers before attempt to parse them (#1487745)
diff --git a/program/lib/washtml.php b/program/lib/washtml.php
index 7f49fec28..f9daadbf5 100644
--- a/program/lib/washtml.php
+++ b/program/lib/washtml.php
@@ -75,6 +75,7 @@
* - changed $ignore_elements behaviour
* - added RFC2397 support
* - base URL support
+ * - invalid HTML comments removal before parsing
*/
class washtml
@@ -271,6 +272,9 @@ class washtml
else
$this->config['base_url'] = '';
+ // Remove invalid HTML comments (#1487759)
+ $html = preg_replace('/<![^>]*>/', '', $html);
+
@$node->loadHTML($html);
return $this->dumpHtml($node);
}