diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-04-29 18:52:42 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-04-29 18:52:42 -0700 |
commit | d02079cf51058085a7e62c33d747b141fe0a1c89 (patch) | |
tree | 24407dc6e239a3ddf5014e35f452aac26c1f5e78 /FS | |
parent | 41466beaadfad0627adf5559d173e1bcc2829939 (diff) |
allow @domain to be passed as part of a white/black-list, RT#20896
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/part_export/http_status.pm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/FS/FS/part_export/http_status.pm b/FS/FS/part_export/http_status.pm index 80139e776..5c4a8d074 100644 --- a/FS/FS/part_export/http_status.pm +++ b/FS/FS/part_export/http_status.pm @@ -129,7 +129,7 @@ sub export_setstatus_listdel { } sub export_setstatus_listX { - my( $self, $svc_x, $action, $list, $address ) = @_; + my( $self, $svc_x, $action, $list, $address_item ) = @_; my $option; if ( $list =~ /^[WA]/i ) { #Whitelist/Allow @@ -139,8 +139,16 @@ sub export_setstatus_listX { } $option .= $action. '_url'; - $address = Email::Valid->address($address) - or die "address failed $Email::Valid::Details check.\n"; + my $address; + unless ( $address = Email::Valid->address($address_item) ) { + + if ( $address_item =~ /^(\@[\w\-\.]+\.\w{2,63})$/ ) { # "@domain" + $address = $1; + } else { + die "address failed $Email::Valid::Details check.\n"; + } + + } #some false laziness w/export_getstatus above my $url; |