if \n or \r we addquote too
This commit is contained in:
parent
4226396da4
commit
41856a920e
@ -307,9 +307,12 @@ class ExportCsv extends ModeleExports
|
|||||||
//print $charset.' '.$newvalue."\n";
|
//print $charset.' '.$newvalue."\n";
|
||||||
|
|
||||||
// Rule 1 CSV: No CR, LF in cells
|
// Rule 1 CSV: No CR, LF in cells
|
||||||
|
$oldvalue=$newvalue;
|
||||||
$newvalue=str_replace("\r",'',$newvalue);
|
$newvalue=str_replace("\r",'',$newvalue);
|
||||||
$newvalue=str_replace("\n",'\n',$newvalue);
|
$newvalue=str_replace("\n",'\n',$newvalue);
|
||||||
|
if($oldvalue != $newvalue)
|
||||||
|
$addquote=1;
|
||||||
|
|
||||||
// Rule 2 CSV: If value contains ", we must escape with ", and add "
|
// Rule 2 CSV: If value contains ", we must escape with ", and add "
|
||||||
if (preg_match('/"/',$newvalue))
|
if (preg_match('/"/',$newvalue))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user