summaryrefslogtreecommitdiff
path: root/LedgerSMB/Template/CSV.pm
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-11 15:18:39 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-11 15:18:39 +0000
commit8b641aca011d4ae738e5b4c327bd2532e1b0ed66 (patch)
treeef0ea215216df3f71ae304fe2c4b1792bdaa8fb3 /LedgerSMB/Template/CSV.pm
parent9f82c1f3c2215c7bb14d38ffa9aa58c6fbd02095 (diff)
Fixing hash and object escaping
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1563 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Template/CSV.pm')
-rwxr-xr-xLedgerSMB/Template/CSV.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/LedgerSMB/Template/CSV.pm b/LedgerSMB/Template/CSV.pm
index 42324a89..cb861e93 100755
--- a/LedgerSMB/Template/CSV.pm
+++ b/LedgerSMB/Template/CSV.pm
@@ -58,11 +58,7 @@ sub preprocess {
for (@{$rawvars}) {
push @{$vars}, preprocess( $_ );
}
- } elsif ( $type eq 'HASH' ) {
- for ( keys %{$rawvars} ) {
- $vars->{preprocess($_)} = preprocess( $rawvars->{$_} );
- }
- } else {
+ } elsif ( !$type ) { # Scalar
$vars = $rawvars;
$vars =~ s/\&nbsp;/ /;
$vars =~ s/(\t\n\r )+/ /g;
@@ -71,6 +67,10 @@ sub preprocess {
$vars =~ s/<.*?>//g;
$vars = qq|"$vars"| if $vars !~ /^\w+$/;
$vars = '' if $vars =~ /^""$/;
+ } else { # hashes and objects
+ for ( keys %{$rawvars} ) {
+ $vars->{preprocess($_)} = preprocess( $rawvars->{$_} );
+ }
}
return $vars;
}