summaryrefslogtreecommitdiff
path: root/LedgerSMB/Template
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-11 17:11:08 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-11 17:11:08 +0000
commitf74c8fa213cd5409084ede2de7ea4ed626895955 (patch)
tree53eda6e24d6232a4eea62372316380ea04534aa3 /LedgerSMB/Template
parent9dca25618c909737218f038abedcec5e123b2784 (diff)
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
Diffstat (limited to 'LedgerSMB/Template')
-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/\&nbsp;/ /;
- $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 {