mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
- escape formulas in CSV export (fix)
This commit is contained in:
parent
8085658e53
commit
c859e1db31
1 changed files with 2 additions and 1 deletions
|
|
@ -66,7 +66,8 @@ function escape_csv($v)
|
|||
{
|
||||
//escape formulas
|
||||
$nf = '';
|
||||
if (strlen($v) > 0 && in_array(substr($v, 0, 1), array('=', '+', '-', '@'))) {
|
||||
$trimmed = ltrim($v);
|
||||
if (strlen($trimmed) > 0 && in_array(substr($trimmed, 0, 1), array('=', '+', '-', '@'))) {
|
||||
$nf = "'";
|
||||
}
|
||||
return '"'. $nf. str_replace('"', '""', $v). '"';
|
||||
|
|
|
|||
Loading…
Reference in a new issue