[Svn] r4483 - in trunk/roundcubemail: . program/lib

trac at roundcube.net trac at roundcube.net
Thu Feb 3 12:52:38 CET 2011


Author: alec
Date: 2011-02-03 05:52:38 -0600 (Thu, 03 Feb 2011)
New Revision: 4483

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/lib/washtml.php
Log:
- Fix handling of invalid HTML comments in messages (#1487759)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-02-02 19:41:41 UTC (rev 4482)
+++ trunk/roundcubemail/CHANGELOG	2011-02-03 11:52:38 UTC (rev 4483)
@@ -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)

Modified: trunk/roundcubemail/program/lib/washtml.php
===================================================================
--- trunk/roundcubemail/program/lib/washtml.php	2011-02-02 19:41:41 UTC (rev 4482)
+++ trunk/roundcubemail/program/lib/washtml.php	2011-02-03 11:52:38 UTC (rev 4483)
@@ -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 @@
     else
       $this->config['base_url'] = '';
 
+    // Remove invalid HTML comments (#1487759)
+    $html = preg_replace('/<![^>]*>/', '', $html);
+
     @$node->loadHTML($html);
     return $this->dumpHtml($node);
   }

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list