From bdb9fd299b99bcdc5694204a3f13cb625bccdc4a Mon Sep 17 00:00:00 2001 From: mrzo2s45 Date: Thu, 8 Sep 2022 17:04:18 +0200 Subject: [PATCH] Fix missing escape of double quotes in CSV output. refs #4910 --- library/Icinga/File/Csv.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/File/Csv.php b/library/Icinga/File/Csv.php index 93792417b..56ee233ee 100644 --- a/library/Icinga/File/Csv.php +++ b/library/Icinga/File/Csv.php @@ -37,7 +37,7 @@ class Csv } $out = array(); foreach ($row as & $val) { - $out[] = '"' . $val . '"'; + $out[] = '"' . str_replace('"', '""', $val) . '"'; } $csv .= implode(',', $out) . "\r\n"; }