Skip to content

Commit

Permalink
Berichte Buchungsliste: Dateinamen in ZIP bereinigen
Browse files Browse the repository at this point in the history
Dateinamen müssen für das ZIP file bereinigt werden,
da Sonderzeichen in der Kontonummer möglich sind.
  • Loading branch information
rebootl authored and bblessmann committed Mar 5, 2024
1 parent 285446a commit e7b1364
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SL/Controller/ListTransactions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ sub action_export_all_charts {
}
$sfile->fh->close;

# we need to sanitize the account number before using it in the filename
# to prevent unexpected outcomes due to slashes etc.
my $sanitized_accno = $account->{accno} =~ s/[^A-Za-z0-9\-\.\_\ ]/_/gr;

$zip->addFile(
$sfile->{file_name},
t8('list_of_transactions') . "_" . t8('account') . "_" . $account->{accno} . ($output_format eq 'PDF' ? '.pdf' : '.csv')
t8('list_of_transactions') . "_" . t8('account') . "_" . $sanitized_accno . ($output_format eq 'PDF' ? '.pdf' : '.csv')
);
}

Expand Down

0 comments on commit e7b1364

Please sign in to comment.