Skip to content

Commit

Permalink
Fixed issue: Survey participant data with quotes is not properly expo…
Browse files Browse the repository at this point in the history
…rted to CSV (#2073)
  • Loading branch information
ViliusS committed Feb 25, 2022
1 parent 75bd304 commit 1c3baeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions application/helpers/export_helper.php
Expand Up @@ -2241,8 +2241,8 @@ function tokensExport($iSurveyID)
}

$tokenoutput .= '"'.trim($brow['tid']).'",';
$tokenoutput .= '"'.trim($brow['firstname']).'",';
$tokenoutput .= '"'.trim($brow['lastname']).'",';
$tokenoutput .= '"'.str_replace('"', '""', trim($brow['firstname'])).'",';
$tokenoutput .= '"'.str_replace('"', '""', trim($brow['lastname'])).'",';
$tokenoutput .= '"'.trim($brow['email']).'",';
$tokenoutput .= '"'.trim($brow['emailstatus']).'",';
$tokenoutput .= '"'.trim($brow['token']).'",';
Expand All @@ -2258,7 +2258,7 @@ function tokensExport($iSurveyID)
$tokenoutput .= '"'.trim($brow['started']).'",';
}
foreach ($attrfieldnames as $attr_name) {
$tokenoutput .= '"'.trim($brow[$attr_name]).'",';
$tokenoutput .= '"'.str_replace('"', '""', trim($brow[$attr_name])).'",';
}
$tokenoutput = substr($tokenoutput, 0, -1); // remove last comma
$tokenoutput .= "\n";
Expand Down

0 comments on commit 1c3baeb

Please sign in to comment.