fix email body plain

This commit is contained in:
Yuri Kuznetsov
2020-05-27 16:38:33 +03:00
parent 86f460866a
commit 57bfea4d70
+13 -11
View File
@@ -145,16 +145,16 @@ class Email extends \Espo\Core\ORM\Entity
$body = strip_tags($body);
$reList = [
'/&(quot|#34);/i',
'/&(amp|#38);/i',
'/&(lt|#60);/i',
'/&(gt|#62);/i',
'/&(nbsp|#160);/i',
'/&(iexcl|#161);/i',
'/&(cent|#162);/i',
'/&(pound|#163);/i',
'/&(copy|#169);/i',
'/&(reg|#174);/i',
'&(quot|#34);',
'&(amp|#38);',
'&(lt|#60);',
'&(gt|#62);',
'&(nbsp|#160);',
'&(iexcl|#161);',
'&(cent|#162);',
'&(pound|#163);',
'&(copy|#169);',
'&(reg|#174);',
];
$replaceList = [
'',
@@ -169,7 +169,9 @@ class Email extends \Espo\Core\ORM\Entity
chr(174),
];
$body = mb_ereg_replace($reList, $replaceList, $body);
foreach ($reList as $i => $re) {
$body = mb_ereg_replace($re, $replaceList[$i], $body, 'i');
}
return $body;
}