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