From ff04a2ea4383818a687443eed356a32428e8a427 Mon Sep 17 00:00:00 2001 From: Silas <67681686+Tqnsls@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:46:21 +0200 Subject: [PATCH] Fix that CSV exports contain empty strings instead of zeros --- 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 d18978040..d0d9c8d9f 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 ? str_replace('"', '""', $val) : '') . '"'; + $out[] = '"' . ($val == '0' ? '0' : ($val ? str_replace('"', '""', $val) : '')) . '"'; } $csv .= implode(',', $out) . "\r\n"; }