diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index 127f23e5c41e..a172071feee8 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -70,13 +70,14 @@ public static function makeCSVTable($header, $rows, $titleHeader = NULL, $output else { // loic1 : always enclose fields //$value = ereg_replace("\015(\012)?", "\012", $value); + // Convert carriage return to line feed. $value = preg_replace("/\015(\012)?/", "\012", $value); if ((substr($value, 0, 1) == CRM_Core_DAO::VALUE_SEPARATOR) && (substr($value, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR) ) { $strArray = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value); - + // Filter out empty value separated strings. foreach ($strArray as $key => $val) { if (trim($val) == '') { unset($strArray[$key]);