-handling HTML comments before doing the kses parse. this fixes a problem with displaying HTML emails, showing some leftovers from comments in

style definitions, which are used as browser switch.
This commit is contained in:
Klaus Leithoff 2008-08-18 11:53:16 +00:00
parent 0baf83c3a8
commit b377de6b86

View File

@ -1003,6 +1003,13 @@
} }
else else
{ {
// no scripts allowed
// clean out comments
$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
);
$newBody = preg_replace($search,"",$newBody);
$newBody = $singleBodyPart['body']; $newBody = $singleBodyPart['body'];
$newBody = $this->highlightQuotes($newBody); $newBody = $this->highlightQuotes($newBody);
$newBody = $this->kses->Parse($newBody); $newBody = $this->kses->Parse($newBody);