summaryrefslogtreecommitdiff
path: root/program/lib/washtml.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-02-03 11:52:38 +0000
committeralecpl <alec@alec.pl>2011-02-03 11:52:38 +0000
commit9ebac6616d32d7672ea59da67321380037e2324c (patch)
tree373121eae037d3269ae64d6320f1108998d770bd /program/lib/washtml.php
parente4e38e02cfe626ffeda26b1d4a08df7a6cd3997d (diff)
- Fix handling of invalid HTML comments in messages (#1487759)
Diffstat (limited to 'program/lib/washtml.php')
-rw-r--r--program/lib/washtml.php4
1 files changed, 4 insertions, 0 deletions
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);
}