diff options
author | Urban Müller | 2024-03-21 18:18:32 +0100 |
---|---|---|
committer | Urban Müller | 2024-03-21 18:18:32 +0100 |
commit | d406a077e01ae593e2f5b01df2118c64025b71ea (patch) | |
tree | cfb92960871da358fabd0e221126000a2a89bba7 | |
parent | 79ba80017e57eafbc3201fbb02054fcf5c5cff88 (diff) | |
download | itools-d406a077e01ae593e2f5b01df2118c64025b71ea.tar.gz itools-d406a077e01ae593e2f5b01df2118c64025b71ea.tar.bz2 itools-d406a077e01ae593e2f5b01df2118c64025b71ea.zip |
allow unicode in local part of mail addresses
-rw-r--r-- | it_mail.class | 2 | ||||
-rwxr-xr-x | 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@example.com>, "Neuman, Alfred E." <neuman@example.com>, aneuman, "<neuman@example>" <neuman@example.com>, " neumann@example.com", "www@search.ch".foo.bar@local.ch, test@sör.ch'), + it_mail::address_error('neuman@example.com, <neuman@example.com>, "Neuman, Alfred E." <neuman@example.com>, aneuman, "<neuman@example>" <neuman@example.com>, " neumann@example.com", "www@search.ch".foo.bar@local.ch, test@sör.ch, müller@search.ch'), null, "Accept valid e-mail addresses" ); |