Bug 28870: Remove traces of Email::Valid
[koha-ffzg.git] / opac / opac-shareshelf.pl
index 701871b..8bb7b60 100755 (executable)
@@ -25,7 +25,7 @@ use constant SHELVES_URL =>
   '/cgi-bin/koha/opac-shelves.pl?display=privateshelves&viewshelf=';
 
 use CGI qw ( -utf8 );
-use Email::Valid;
+use Email::Address;
 
 use C4::Auth qw( get_template_and_user );
 use C4::Context;
@@ -195,7 +195,7 @@ sub process_addrlist {
     foreach my $a (@temp) {
         $a =~ s/^\s+//;
         $a =~ s/\s+$//;
-        if ( IsEmailAddress($a) ) {
+        if ( $a =~ m/$Email::Address::mailbox/ ) {
             push @appr_addr, $a;
         }
         else {
@@ -296,12 +296,6 @@ sub load_template_vars {
     );
 }
 
-sub IsEmailAddress {
-
-    #TODO candidate for a module?
-    return Email::Valid->address( $_[0] ) ? 1 : 0;
-}
-
 sub randomlist {
 
     #uses rand, safe enough for this application but not for more sensitive data