Replace all CRLF in values with CR so Excel doesn't break lines early.

This commit is contained in:
Nathan Gray 2010-12-10 21:11:15 +00:00
parent cc72785afe
commit bbd874dc05

View File

@ -335,7 +335,7 @@ class importexport_export_csv implements importexport_iface_export_record
$writeDelimiter = false;
foreach($dataArray as $dataElement) {
if($writeDelimiter) $string .= $delimiter;
$string .= $enclosure . $dataElement . $enclosure;
$string .= $enclosure . str_replace("\r\n", "\r", $dataElement) . $enclosure;
$writeDelimiter = true;
}
$string .= "\n";