mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 17:04:14 +01:00
fixing display issues encountered while displaying HTML Mails. Greedy preg_replace ate away too much
This commit is contained in:
parent
26c2eec08f
commit
e90ad24156
@ -782,13 +782,13 @@
|
||||
if ($_body) {
|
||||
if ($addbracesforendtag === true )
|
||||
{
|
||||
$_body = preg_replace('~<'.$tag.'[^>]*?>(.*)</'.$endtag.'>~sim','',$_body);
|
||||
$_body = preg_replace('~<'.$tag.'[^>]*?>(.*)</'.$endtag.'[\s]*>~simU','',$_body);
|
||||
// remove left over tags, unfinished ones, and so on
|
||||
$_body = preg_replace('~<'.$tag.'[^>]*?>~si','',$_body);
|
||||
}
|
||||
if ($addbracesforendtag === false )
|
||||
{
|
||||
$_body = preg_replace('~<'.$tag.'[^>]*?>(.*)'.$endtag.'~sim','',$_body);
|
||||
$_body = preg_replace('~<'.$tag.'[^>]*?>(.*)'.$endtag.'~simU','',$_body);
|
||||
// remove left over tags, unfinished ones, and so on
|
||||
$_body = preg_replace('~<'.$tag.'[^>]*?>~si','',$_body);
|
||||
$_body = preg_replace('~'.$endtag.'~','',$_body);
|
||||
@ -799,8 +799,9 @@
|
||||
static function getCleanHTML(&$_html)
|
||||
{
|
||||
// remove CRLF and TAB as it is of no use in HTML.
|
||||
$_html = str_replace("\r\n",' ',$_html);
|
||||
$_html = str_replace("\t",' ',$_html);
|
||||
// but they are of means in pre formatted text, so we rather dont
|
||||
//$_html = str_replace("\r\n",' ',$_html);
|
||||
//$_html = str_replace("\t",' ',$_html);
|
||||
|
||||
self::replaceTagsCompletley($_html,'style'); // clean out empty or pagewide style definitions / left over tags
|
||||
self::replaceTagsCompletley($_html,'head'); // Strip out stuff in head
|
||||
|
Loading…
Reference in New Issue
Block a user