replace original message header with fieldset in html and convert it to plain as before

This commit is contained in:
ralf
2022-05-10 11:51:35 +02:00
parent 5791ef0117
commit c4e0989bf9
2 changed files with 52 additions and 22 deletions

View File

@ -273,7 +273,7 @@ class Html
chr(161),
chr(162),
chr(163),
'(C)',//chr(169),// copyrighgt
'(C)',//chr(169),// copyright
'(R)',//chr(174),// registered
'(TM)',// trade
"'",
@ -282,6 +282,16 @@ class Html
);
$_html = preg_replace($Rules, $Replace, $_html);
// replace fieldset with legend used for original message header
$_html = preg_replace_callback('#<fieldset[^>]*>\s*<legend>(.*)</legend>\s*(.*)\s*</fieldset>#sm',
static function($matches)
{
$len_legend = strlen($legend = $matches[1]);
$content = preg_replace('/<([^@> ]+@[^> ]+)>/', '#lower#than#$1#greater#than#', $matches[2]);
return "<br>".str_repeat('-', (64-$len_legend-2)>>1).' '.$legend.' '.str_repeat('-', (64-$len_legend-2+1)>>1)."<br>".
$content.str_repeat('-', 64)."<br>";
}, $_html);
// removing carriage return linefeeds, preserve those enclosed in <pre> </pre> tags
if ($stripcrl === true )
{
@ -584,4 +594,4 @@ class Html
//error_log(__METHOD__.__LINE__.array2string($html2ret));
return $html2ret;
}
}
}