From f74c8fa213cd5409084ede2de7ea4ed626895955 Mon Sep 17 00:00:00 2001 From: tetragon Date: Tue, 11 Sep 2007 17:11:08 +0000 Subject: Removing some testing steps from CSV escaping Fixing the mimetype It's comma time git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1566 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Template/CSV.pm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'LedgerSMB/Template') 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 { -- cgit v1.2.3