diff --git a/application/helpers/export_helper.php b/application/helpers/export_helper.php index 90a9d9b38bc..165cac9e94a 100644 --- a/application/helpers/export_helper.php +++ b/application/helpers/export_helper.php @@ -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']).'",'; @@ -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";