fix PHP 8.x TypeError sending mail

This commit is contained in:
ralf 2022-05-10 18:43:30 +02:00
parent 99588796da
commit ced6c77f46

View File

@ -283,13 +283,13 @@ class Html
$_html = preg_replace($Rules, $Replace, $_html); $_html = preg_replace($Rules, $Replace, $_html);
// replace fieldset with legend used for original message header // replace fieldset with legend used for original message header
$_html = preg_replace_callback('#<fieldset[^>]*>\s*<legend>(.*)</legend>\s*(.*)\s*</fieldset>#sm', $_html = preg_replace_callback('#<fieldset[^>]*>\s*<legend>(.*?)</legend>\s*(.*?)\s*</fieldset>#sm',
static function($matches) static function($matches)
{ {
$len_legend = strlen($legend = $matches[1]); $len_legend = strlen($legend = $matches[1]);
$content = preg_replace('/<([^@> ]+@[^> ]+)>/', '#lower#than#$1#greater#than#', $matches[2]); $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>". return "<br>".str_repeat('-', (64-$len_legend-2)>>1).' '.$legend.' '.str_repeat('-', (64-$len_legend-2+1)>>1)."<br>".
$content.str_repeat('-', 64)."<br>"; $content."<br>".str_repeat('-', 64)."<br>";
}, $_html); }, $_html);
// removing carriage return linefeeds, preserve those enclosed in <pre> </pre> tags // removing carriage return linefeeds, preserve those enclosed in <pre> </pre> tags