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

SF.net SVN: ledger-smb: [1792] trunk/LedgerSMB/Mailer.pm



Revision: 1792
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1792&view=rev
Author:   tetragon
Date:     2007-10-18 19:04:13 -0700 (Thu, 18 Oct 2007)

Log Message:
-----------
Check for a filename before trying to filter it

Modified Paths:
--------------
    trunk/LedgerSMB/Mailer.pm

Modified: trunk/LedgerSMB/Mailer.pm
===================================================================
--- trunk/LedgerSMB/Mailer.pm	2007-10-19 01:50:19 UTC (rev 1791)
+++ trunk/LedgerSMB/Mailer.pm	2007-10-19 02:04:13 UTC (rev 1792)
@@ -125,10 +125,14 @@
 	carp "Message not prepared" unless ref $self->{_message};
 
 	# strip path from output name
-	my $file = $args{filename};
-	my $strip = quotemeta $args{strip};
-	$file =~ s/(.*\/|$strip)//g;
+	my $file;
+	if ($args{filename}) {
+		my $strip = quotemeta $args{strip};
+		$file = $args{filename};
+		$file =~ s/(.*\/|$strip)//g;
+        }
 
+	# handle both string and file types of input
 	my @data;
 	if ($args{data}) {
 		@data = ('Data', $args{data});


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