mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
fix(csv): fix #5279 always force subject to be a string
When performing a str_replace, subject should always be a string. If passing a non-existent column or empty column, subject may be null This ensure str_replace is called when subject is actually a string (not NULL)
This commit is contained in:
parent
2864e60d78
commit
295d7290a4
@ -37,7 +37,7 @@ class Csv
|
||||
}
|
||||
$out = array();
|
||||
foreach ($row as & $val) {
|
||||
$out[] = '"' . str_replace('"', '""', $val) . '"';
|
||||
$out[] = '"' . ($val ? str_replace('"', '""', $val) : '') . '"';
|
||||
}
|
||||
$csv .= implode(',', $out) . "\r\n";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user