Bug 28870: Remove traces of Email::Valid
[koha-ffzg.git] / members / memberentry.pl
index 5844b9c..eda147c 100755 (executable)
@@ -44,7 +44,7 @@ use Koha::Patron::Categories;
 use Koha::Patron::HouseboundRole;
 use Koha::Patron::HouseboundRoles;
 use Koha::Token;
-use Email::Valid;
+use Email::Address;
 use Koha::SMS::Providers;
 
 my $input = CGI->new;
@@ -386,13 +386,13 @@ if ($op eq 'save' || $op eq 'insert'){
   my $emailalt = $input->param('B_email');
 
   if ($emailprimary) {
-      push (@errors, "ERROR_bad_email") if (!Email::Valid->address($emailprimary));
+      push (@errors, "ERROR_bad_email") if ($emailprimary !~ m/$Email::Address::mailbox/);
   }
   if ($emailsecondary) {
-      push (@errors, "ERROR_bad_email_secondary") if (!Email::Valid->address($emailsecondary));
+      push (@errors, "ERROR_bad_email_secondary") if ($emailsecondary !~ m/$Email::Address::mailbox/);
   }
   if ($emailalt) {
-      push (@errors, "ERROR_bad_email_alternative") if (!Email::Valid->address($emailalt));
+      push (@errors, "ERROR_bad_email_alternative") if ($emailalt !~ m/$Email::Address::mailbox/);
   }
 
   if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {