diff --git a/htdocs/includes/modules/export/export_csv.modules.php b/htdocs/includes/modules/export/export_csv.modules.php index e560e4ec9a5..779c0303dd7 100644 --- a/htdocs/includes/modules/export/export_csv.modules.php +++ b/htdocs/includes/modules/export/export_csv.modules.php @@ -131,7 +131,7 @@ class ExportCsv extends ModeleExports { $alias=$array_alias[$code]; //print "dd".$alias; - $newvalue=ereg_replace(';',',',$objp->$alias); + $newvalue=ereg_replace(';',',',clean_html($objp->$alias)); $newvalue=ereg_replace("\r",'',$newvalue); $newvalue=ereg_replace("\n",'\n',$newvalue); fwrite($this->handle,$newvalue.";"); diff --git a/htdocs/includes/modules/export/export_excel.modules.php b/htdocs/includes/modules/export/export_excel.modules.php index edfb3e90fc4..78ff0c8396e 100644 --- a/htdocs/includes/modules/export/export_excel.modules.php +++ b/htdocs/includes/modules/export/export_excel.modules.php @@ -148,7 +148,7 @@ class ExportExcel extends ModeleExports { $alias=$array_alias[$code]; //print "dd".$alias; - $this->worksheet->write($this->row, $this->col, $objp->$alias); + $this->worksheet->write($this->row, $this->col, clean_html($objp->$alias)); $this->col++; } $this->row++; diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 670e0013de0..c027ecad58f 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -2295,4 +2295,17 @@ function weight_units_string($unit) return $weight_string[$unit]; } + +/** + \brief Nettoie le code HTML + \param string StringHtml + \return string CleanString + \todo nettoyer les balises html +*/ +function clean_html($StringHtml) +{ + $CleanString = html_entity_decode($StringHtml); + return $CleanString; +} + ?>