https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28870
--- Comment #4 from Tomás Cohen Arazi <[email protected]> --- Ok, I've been playing with this. My conclusion is that Jonathan is right: Email::Valid is buggy. I've learnt that regexps for validating RFC2822 addresses are not trivial [1] The author/maintainer of the libraries we use, also maintains the Email::Address library, that provides such regular expressions. My tests (on Debian Buster) verify that Email::Address is able to handle UTF-8 characters correctly. I can submit a patch that replaces one library with the other (will probably do it anyway) but I have doubts about the importance of validating email addresses here. It feels like overkill. [1] https://metacpan.org/pod/Email::Address#Package-Variables The script I used for testing: #!/usr/bin/perl use Modern::Perl; use utf8; use Email::Address; use Email::Valid; binmode STDOUT, ':encoding(UTF-8)'; binmode STDERR, ':encoding(UTF-8)'; my $string = 'Tomás Cohen Arazi <[email protected]>'; my ($email) = Email::Address->parse($string); ## This construct could be used instead of manually crafting ## the address in the $string format above. Same results # my $email = Email::Address->new( # 'Tomás Cohen Arazi' => '[email protected]' # ); print "Testing address: $email\n"; say "Email::Address tests =>"; if ( "$email" =~ m/$Email::Address::mailbox/ ) { say "Yay!"; } else { say "Boo!"; } say "Email::Valid tests =>"; if (Email::Valid->address( -address => "$email", -fqdn => 0 )) { say "Yay!"; } else { say "Boo!"; } 1; -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
