mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 10:54:52 +00:00
Add CSV Escaping to the Sample Export CSV Files
This commit is contained in:
@@ -700,6 +700,8 @@ if (isset($_POST["import_clients_csv"])) {
|
||||
if (isset($_GET['download_clients_csv_template'])) {
|
||||
|
||||
$delimiter = ",";
|
||||
$enclosure = '"';
|
||||
$escape = '\\'; // backsla
|
||||
$filename = "Clients-Template.csv";
|
||||
|
||||
//create a file pointer
|
||||
@@ -707,7 +709,7 @@ if (isset($_GET['download_clients_csv_template'])) {
|
||||
|
||||
//set column headers
|
||||
$fields = array('Client Name', 'Industry', 'Referral', 'Website', 'Primary Location Name', 'Location Phone', 'Location Address', 'City', 'State', 'Postal Code', 'Country', 'Primary Contact Name', 'Title', 'Contact Phone', 'Extension', 'Contact Mobile', 'Contact Email', 'Hourly Rate', 'Currency', 'Payment Terms', 'Tax ID', 'Abbreviation');
|
||||
fputcsv($f, $fields, $delimiter);
|
||||
fputcsv($f, $fields, $delimiter, $enclosure, $escape);
|
||||
|
||||
//move back to beginning of file
|
||||
fseek($f, 0);
|
||||
|
||||
Reference in New Issue
Block a user