[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5131] branches/1.3/LedgerSMB/Template/CSV.pm



Revision: 5131
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5131&view=rev
Author:   hasorli
Date:     2012-10-03 04:08:23 +0000 (Wed, 03 Oct 2012)
Log Message:
-----------
Fix Bug ID:3559403 Apply patch from Nick Prater  
http://www.npbroadcast.com/fix-csv-code-dereference-error.patch

Modified Paths:
--------------
    branches/1.3/LedgerSMB/Template/CSV.pm

Modified: branches/1.3/LedgerSMB/Template/CSV.pm
===================================================================
--- branches/1.3/LedgerSMB/Template/CSV.pm	2012-09-28 06:47:09 UTC (rev 5130)
+++ branches/1.3/LedgerSMB/Template/CSV.pm	2012-10-03 04:08:23 UTC (rev 5131)
@@ -70,12 +70,15 @@
 			# Scalars or GMP objects (which are SCALAR refs) --CT
 		if ($type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') {
 			$vars = $$rawvars;
+			return unless defined $vars;
 		} else {
 			$vars = $rawvars;
 		}
 		$vars =~ s/(^ +| +$)//g;
 		$vars =~ s/"/""/g;
 		$vars = qq|"$vars"| if $vars =~ /[^0-9.+-]/;
+	} elsif ( $type eq 'CODE' ) { # a code reference makes no sense
+		return undef;
 	} else { # hashes and objects
 		for ( keys %{$rawvars} ) {
 			$vars->{$_} = preprocess( $rawvars->{$_} );

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.