From d406a077e01ae593e2f5b01df2118c64025b71ea Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 21 Mar 2024 18:18:32 +0100 Subject: allow unicode in local part of mail addresses --- it_mail.class | 2 +- test/it_mail.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/it_mail.class b/it_mail.class index 5924569..63bcc28 100644 --- a/it_mail.class +++ b/it_mail.class @@ -507,7 +507,7 @@ static function address_error($addresslist) foreach (self::addrlist_split($addresslist) as list($dummy, $email)) { $email = self::email_encode($email); - if (filter_var($email, FILTER_VALIDATE_EMAIL) === false && !it::match('^\s*[a-z][-a-z0-9]*\s*$', $email)) + if (filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE) === false && !it::match('^\s*[a-z][-a-z0-9]*\s*$', $email)) return "invalid format on $email"; } } diff --git a/test/it_mail.t b/test/it_mail.t index 41a92b1..12b70d0 100755 --- a/test/it_mail.t +++ b/test/it_mail.t @@ -101,7 +101,7 @@ is( ); is( - it_mail::address_error('neuman@example.com, , "Neuman, Alfred E." , aneuman, "" , " neumann@example.com", "www@search.ch".foo.bar@local.ch, test@sör.ch'), + it_mail::address_error('neuman@example.com, , "Neuman, Alfred E." , aneuman, "" , " neumann@example.com", "www@search.ch".foo.bar@local.ch, test@sör.ch, müller@search.ch'), null, "Accept valid e-mail addresses" ); -- cgit v1.2.3