Fix error too large regex in memory

This commit is contained in:
Laurent Destailleur 2022-10-28 04:20:54 +02:00
parent d1cd43c9d8
commit c9f43dc7a6

View File

@ -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++;
}