summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2024-03-21 18:18:32 +0100
committerUrban Müller2024-03-21 18:18:32 +0100
commitd406a077e01ae593e2f5b01df2118c64025b71ea (patch)
treecfb92960871da358fabd0e221126000a2a89bba7
parent79ba80017e57eafbc3201fbb02054fcf5c5cff88 (diff)
downloaditools-d406a077e01ae593e2f5b01df2118c64025b71ea.tar.gz
itools-d406a077e01ae593e2f5b01df2118c64025b71ea.tar.bz2
itools-d406a077e01ae593e2f5b01df2118c64025b71ea.zip
allow unicode in local part of mail addresses
-rw-r--r--it_mail.class2
-rwxr-xr-xtest/it_mail.t2
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"
);