Skip to content

Commit ff04a2e

Browse files
authored
Fix that CSV exports contain empty strings instead of zeros
1 parent 6c7f1e5 commit ff04a2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/Icinga/File/Csv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __toString()
3737
}
3838
$out = array();
3939
foreach ($row as & $val) {
40-
$out[] = '"' . ($val ? str_replace('"', '""', $val) : '') . '"';
40+
$out[] = '"' . ($val == '0' ? '0' : ($val ? str_replace('"', '""', $val) : '')) . '"';
4141
}
4242
$csv .= implode(',', $out) . "\r\n";
4343
}

0 commit comments

Comments
 (0)