From c9f43dc7a6232ab25327ac92c2f28dc366a4320b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 04:20:54 +0200 Subject: [PATCH] Fix error too large regex in memory --- htdocs/core/class/CMailFile.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 49269b47f2c..e21a288e53e 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1761,7 +1761,7 @@ class CMailFile /* global $dolibarr_main_data_root; $outputfile = $dolibarr_main_data_root."/dolibarr_mail.log"; - $fp = fopen($outputfile, "w"); + $fp = fopen($outputfile, "w+"); fwrite($fp, $this->html); fclose($fp); */ @@ -1808,7 +1808,7 @@ class CMailFile // type $this->html_images[$i]["type"] = 'cidfromdata'; - $this->html = preg_replace('/src="data:image\/'.$ext.';base64,'.preg_quote($filecontent, '/').'"/', 'src="cid:'.$this->html_images[$i]["cid"].'"', $this->html); + $this->html = str_replace('src="data:image/'.$ext.';base64,'.$filecontent.'"', 'src="cid:'.$this->html_images[$i]["cid"].'"', $this->html); } $i++; }