Fix images into medias not reabable into send emails

This commit is contained in:
Laurent Destailleur
2017-06-17 10:44:08 +02:00
parent 5b7a8e9c90
commit bebe7baa80
3 changed files with 23 additions and 11 deletions

View File

@@ -865,7 +865,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
// Make a change into HTML code to allow to include images from medias directory.
// <img alt="" src="/dolibarr_dev/htdocs/viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
// become
// <img src="'.DOL_DATA_ROOT.'/media/image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
// <img alt="" src="'.DOL_DATA_ROOT.'/media/image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
$newfreetext=preg_replace('/(<img.*src=")[^\"]*viewimage\.php[^\"]*modulepart=medias[^\"]*file=([^\"]*)("[^\/]*\/>)/', '\1'.DOL_DATA_ROOT.'/medias/\2\3', $newfreetext);
$line.=$outputlangs->convToOutputCharset($newfreetext);