summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/Template/CSV.pm10
1 files changed, 3 insertions, 7 deletions
diff --git a/LedgerSMB/Template/CSV.pm b/LedgerSMB/Template/CSV.pm
index cb861e93..c0ff7276 100755
--- a/LedgerSMB/Template/CSV.pm
+++ b/LedgerSMB/Template/CSV.pm
@@ -60,13 +60,9 @@ sub preprocess {
}
} elsif ( !$type ) { # Scalar
$vars = $rawvars;
- $vars =~ s/\ / /;
- $vars =~ s/(\t\n\r )+/ /g;
$vars =~ s/(^ +| +$)//g;
- $vars =~ s/~/\\~/g;
- $vars =~ s/<.*?>//g;
- $vars = qq|"$vars"| if $vars !~ /^\w+$/;
- $vars = '' if $vars =~ /^""$/;
+ $vars =~ s/"/""/g;
+ $vars = qq|"$vars"| if $vars !~ /^\w*$/;
} else { # hashes and objects
for ( keys %{$rawvars} ) {
$vars->{preprocess($_)} = preprocess( $rawvars->{$_} );
@@ -94,7 +90,7 @@ sub process {
"$parent->{outputfile}.csv", binmode => ':utf8')) {
throw Error::Simple $template->error();
}
- $parent->{mimetype} = 'text/plain';
+ $parent->{mimetype} = 'text/csv';
}
sub postprocess {