diff --git a/modules/anagrafiche/bulk.php b/modules/anagrafiche/bulk.php index c1e1e4fd3..69bad046e 100755 --- a/modules/anagrafiche/bulk.php +++ b/modules/anagrafiche/bulk.php @@ -176,7 +176,7 @@ $handle = fopen($file, 'w'); // Scrittura dell'intestazione - fputcsv($handle, ['email', 'ragione_sociale', 'fonte', 'sede_referente'], ';'); + fputcsv($handle, ['email', 'ragione_sociale', 'fonte', 'sede_referente'], ';', escape: '\\'); // Scrittura dei dati foreach ($results as $row) { @@ -185,7 +185,7 @@ $row['ragione_sociale'], $row['fonte'], $row['sede_referente'], - ], ';'); + ], ';', escape: '\\'); } fclose($handle); diff --git a/modules/articoli/src/Import/CSV.php b/modules/articoli/src/Import/CSV.php index 19a8d7f41..6ff1fda98 100644 --- a/modules/articoli/src/Import/CSV.php +++ b/modules/articoli/src/Import/CSV.php @@ -619,12 +619,12 @@ public function saveFailedRecordsWithErrors($filepath) $header = $this->getHeader(); $header[] = 'Errore'; - fputcsv($file, $header, ';'); + fputcsv($file, $header, ';', escape: '\\'); foreach ($this->failed_rows as $index => $row) { $error_message = $this->failed_errors[$index] ?? 'Errore sconosciuto'; $row[] = $error_message; - fputcsv($file, $row, ';'); + fputcsv($file, $row, ';', escape: '\\'); } fclose($file); diff --git a/modules/impianti/src/Import/CSV.php b/modules/impianti/src/Import/CSV.php index 0cb3ec9dc..5bc5baf26 100644 --- a/modules/impianti/src/Import/CSV.php +++ b/modules/impianti/src/Import/CSV.php @@ -234,12 +234,12 @@ public function saveFailedRecordsWithErrors($filepath) $header = $this->getHeader(); $header[] = 'Errore'; - fputcsv($file, $header, ';'); + fputcsv($file, $header, ';', escape: '\\'); foreach ($this->failed_rows as $index => $row) { $error_message = $this->failed_errors[$index] ?? 'Errore sconosciuto'; $row[] = $error_message; - fputcsv($file, $row, ';'); + fputcsv($file, $row, ';', escape: '\\'); } fclose($file); diff --git a/modules/liste_newsletter/actions.php b/modules/liste_newsletter/actions.php index 3c31b2648..24be08161 100755 --- a/modules/liste_newsletter/actions.php +++ b/modules/liste_newsletter/actions.php @@ -146,7 +146,7 @@ $handle = fopen($file, 'w'); // Scrittura dell'intestazione - fputcsv($handle, ['Email', 'Ragione sociale'], ';'); + fputcsv($handle, ['Email', 'Ragione sociale'], ';', escape: '\\'); // Scrittura dei dati foreach ($results as $destinatario) { @@ -156,7 +156,7 @@ fputcsv($handle, [ $origine->email, $anagrafica->ragione_sociale, - ], ';'); + ], ';', escape: '\\'); } fclose($handle); diff --git a/modules/listini_cliente/src/Import/CSV.php b/modules/listini_cliente/src/Import/CSV.php index 29336b421..34393814e 100644 --- a/modules/listini_cliente/src/Import/CSV.php +++ b/modules/listini_cliente/src/Import/CSV.php @@ -229,12 +229,12 @@ public function saveFailedRecordsWithErrors($filepath) $header = $this->getHeader(); $header[] = 'Errore'; - fputcsv($file, $header, ';'); + fputcsv($file, $header, ';', escape: '\\'); foreach ($this->failed_rows as $index => $row) { $error_message = $this->failed_errors[$index] ?? 'Errore sconosciuto'; $row[] = $error_message; - fputcsv($file, $row, ';'); + fputcsv($file, $row, ';', escape: '\\'); } fclose($file); diff --git a/src/Importer/CSVImporter.php b/src/Importer/CSVImporter.php index b98496869..c94aebd2d 100644 --- a/src/Importer/CSVImporter.php +++ b/src/Importer/CSVImporter.php @@ -224,7 +224,7 @@ public static function createExample($filepath) fprintf($file, chr(0xEF).chr(0xBB).chr(0xBF)); foreach ($content as $row) { - fputcsv($file, $row, ';'); + fputcsv($file, $row, ';', escape: '\\'); } fclose($file); @@ -348,14 +348,14 @@ public function saveFailedRecordsWithErrors($filepath) // Scrivi l'intestazione con colonna errore $header = $this->getHeader(); $header[] = 'Errore'; - fputcsv($file, $header, ';'); + fputcsv($file, $header, ';', escape: '\\'); } // Scrivi le righe fallite con errore foreach ($this->failed_rows as $index => $row) { $error_message = $this->failed_errors[$index] ?? 'Errore sconosciuto'; $row[] = $error_message; - fputcsv($file, $row, ';'); + fputcsv($file, $row, ';', escape: '\\'); } fclose($file);