Add CSV Escaping to the Sample Export CSV Files

This commit is contained in:
johnnyq
2025-12-02 15:18:20 -05:00
parent e1a579387f
commit a430bb917e
5 changed files with 19 additions and 6 deletions

View File

@@ -456,6 +456,8 @@ if (isset($_POST["import_credentials_csv"])) {
if (isset($_GET['download_credentials_csv_template'])) {
$delimiter = ",";
$enclosure = '"';
$escape = '\\';
$filename = "Credentials-Template.csv";
//create a file pointer
@@ -463,7 +465,7 @@ if (isset($_GET['download_credentials_csv_template'])) {
//set column headers
$fields = array('Name', 'Description', 'Username', 'Password', 'TOTP', 'URI');
fputcsv($f, $fields, $delimiter);
fputcsv($f, $fields, $delimiter, $enclosure, $escape);
//move back to beginning of file
fseek($f, 0);