From 277564d7e276bb20599e4745119f90c962f31f67 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Dec 2011 20:20:16 +0100 Subject: [PATCH] Fix: Avoid to encode with dol_htmlentitiesbr twice. --- htdocs/core/lib/pdf.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 7ae27328327..0a304401647 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -694,7 +694,6 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide else { $labelproductservice=pdf_getlinedesc($object,$i,$outputlangs,$hideref,$hidedesc,$issupplierline); - // Description $pdf->writeHTMLCell($w, $h, $posx, $posy, $outputlangs->convToOutputCharset($labelproductservice), 0, 1); @@ -764,11 +763,11 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl { if ($idprod) { - if ( empty($hidedesc) ) $libelleproduitservice.=dol_htmlentitiesbr($desc,1); + if ( empty($hidedesc) ) $libelleproduitservice.=$desc; } else { - $libelleproduitservice.=dol_htmlentitiesbr($desc,1); + $libelleproduitservice.=$desc; } } } @@ -805,8 +804,6 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl } } - $libelleproduitservice=dol_htmlentitiesbr($libelleproduitservice,1); - if ($object->lines[$i]->date_start || $object->lines[$i]->date_end) { $format='day'; @@ -824,7 +821,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl $period='('.$outputlangs->transnoentitiesnoconv('DateUntil',dol_print_date($object->lines[$i]->date_end, $format, false, $outputlangs)).')'; } //print '>'.$outputlangs->charset_output.','.$period; - $libelleproduitservice.="
".dol_htmlentitiesbr($period,1); + $libelleproduitservice.="\n".$period; //print $libelleproduitservice; } @@ -841,6 +838,9 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl $libelleproduitservice.="
".$tmptxt; }*/ + // Now we convert \n into br + $libelleproduitservice=dol_htmlentitiesbr($libelleproduitservice,1); + return $libelleproduitservice; }