From 57bfea4d701f0ea7d1794aaf4537a3233cdfd9b6 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 27 May 2020 16:38:33 +0300 Subject: [PATCH] fix email body plain --- application/Espo/Entities/Email.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/application/Espo/Entities/Email.php b/application/Espo/Entities/Email.php index e547d0c9ca..0d53146c64 100644 --- a/application/Espo/Entities/Email.php +++ b/application/Espo/Entities/Email.php @@ -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; }