diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index 4221553c48d..f4076c7c327 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -2710,7 +2710,7 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8')
if (dol_textishtml($stringtoencode))
{
//$trans = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT); var_dump($trans);
- $newstring=preg_replace('/
','
',$stringtoencode); // Replace "
" by "
". It's same and avoid pb with FPDF.
+ $newstring=preg_replace('/
/i','
',$stringtoencode); // Replace "
" by "
". It's same and avoid pb with FPDF.
$newstring=preg_replace('/
$/i','',$newstring); // Replace "
" by "
". It's same and avoid pb with FPDF.
$newstring=strtr($newstring,array('&'=>'__and__','<'=>'__lt__','>'=>'__gt__','"'=>'__dquot__'));
$newstring=@htmlentities($newstring,ENT_COMPAT,$pagecodefrom); // Make entity encoding