about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2002-05-24 18:03:53 +0000
committerGraham Barr <gbarr@pobox.com>2002-05-24 18:03:53 +0000
commite1d74b3d1b8e635f4086015dc59f9e3c9de73c19 (patch)
tree0310c9efc739ea99d1693647e7fc8aa6a74af996
parent67c53808104993e3f5a6a79adecd0da4c10e67ee (diff)
downloadperl-libnet-e1d74b3d1b8e635f4086015dc59f9e3c9de73c19.tar.gz
Net::SMTP
- Minor change to address sanitize code, mainly to allow <>

-rw-r--r--Net/SMTP.pm21
1 files changed, 7 insertions, 14 deletions
diff --git a/Net/SMTP.pm b/Net/SMTP.pm
index 5412c17..a7096cc 100644
--- a/Net/SMTP.pm
+++ b/Net/SMTP.pm
@@ -16,7 +16,7 @@ use IO::Socket;
 use Net::Cmd;
 use Net::Config;
 
-$VERSION = "2.22"; # $Id: //depot/libnet/Net/SMTP.pm#23 $
+$VERSION = "2.23"; # $Id: //depot/libnet/Net/SMTP.pm#24 $
 
 @ISA = qw(Net::Cmd IO::Socket::INET);
 
@@ -156,20 +156,13 @@ sub supports {
     return;
 }
 
-sub _addr
-{
- my $addr = shift || "";
-
- return $1
-    if $addr =~ /(<[^>]+>)/so;
-
- $addr =~ s/\n/ /sog;
- $addr =~ s/(\A\s+|\s+\Z)//sog;
-
- return "<" . $addr . ">";
+sub _addr {
+  my $addr = shift;
+  $addr = "" unless defined $addr;
+  $addr =~ s/^\s*<?\s*|\s*>?\s*$//sg;
+  "<$addr>";
 }
 
-
 sub mail
 {
  my $me = shift;
@@ -647,6 +640,6 @@ it under the same terms as Perl itself.
 
 =for html <hr>
 
-I<$Id: //depot/libnet/Net/SMTP.pm#23 $>
+I<$Id: //depot/libnet/Net/SMTP.pm#24 $>
 
 =cut