* CSV Export: Replace CRLF with LF so excel does not break lines early (myStylite#974)

This commit is contained in:
Klaus Leithoff 2010-12-16 15:11:33 +00:00
parent 5cd49ff707
commit a8a8e1d6f2

View File

@ -1117,7 +1117,6 @@ class nextmatch_widget
foreach($fields as $field => $label)
{
$value = (array)$data[$field];
if ($use_type && is_array($label) && in_array($label['type'],array('select-account','select-cat','date-time','date','select','int','float')))
{
foreach($value as $key => $val)
@ -1176,6 +1175,7 @@ class nextmatch_widget
if (strpos($value,$separator) !== false || strpos($value,"\n") !== false || strpos($value,"\r") !== false)
{
$value = '"'.str_replace(array('\\','"'),array('\\\\','\\"'),$value).'"';
$value = str_replace("\r\n", "\n", $value); // to avoid early linebreak by Excel
}
$out[] = $value;
}