diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-19 02:04:13 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-19 02:04:13 +0000 |
commit | 6253305b511a0d1f058cbdf5fbc365fdc15f0003 (patch) | |
tree | 0a0de5f66c3bd5b345287d753ce781104f34c1e5 | |
parent | 6247324f8e4d9f9d141cf4a814c1d75540bd49fb (diff) |
Check for a filename before trying to filter it
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1792 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r-- | LedgerSMB/Mailer.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/LedgerSMB/Mailer.pm b/LedgerSMB/Mailer.pm index 6ff22c62..a650d4e1 100644 --- a/LedgerSMB/Mailer.pm +++ b/LedgerSMB/Mailer.pm @@ -125,10 +125,14 @@ sub attach { 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}); |