Ignore CSV labels with a whitespace

Currently, exporting the alias list to CSV, the first column label is only a whitespace. For some reason the contents of this column consists of a long concatenation of "nbsp;"s.
This fix ignores the whitespace column label and gets rid of the "nbsp;nbsp;......" contents of this column.
This was successfully tested on a running installation of postfixadmin 3.2 on a Debian 11 system.
This commit is contained in:
Dennis Lübke authored and GitHub committed 2023-02-01 12:28:58 +01:00
1 parent fcf14f0165
commit 5476bb3abd
1 file changed
+1 -1
+1 -1
View File
@@ -120,7 +120,7 @@ if (safeget('output') == 'csv') {
$columns = array();
foreach ($handler->getStruct() as $key => $field) {
$label = trim($field['label']);
if ($field['display_in_list'] && $label != '') { # don't show fields without a label
if ($field['display_in_list'] && $label != '' && $label != ' ') { # don't show fields without a label and those with a whitespace
$header[] = html_entity_decode($label, ENT_COMPAT | ENT_HTML401, 'UTF-8');
$columns[] = $key;
}