]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/lib/washtml.php
Imported Upstream version 0.5.1
[roundcube.git] / program / lib / washtml.php
index 7f49fec283000286c418883ccfddfc41071bf600..0f8dc7ee614863ec35cf0fd5f638d8b19510c973 100644 (file)
@@ -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);
   }