Skip to content

Commit 0a27ba8

Browse files
committed
Support unicode characters in emails
1 parent cd4f5c2 commit 0a27ba8

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/Value/Email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
private function __construct(string $value)
2424
{
25-
if ($value === '' || filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
25+
if ($value === '' || filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE) === false) {
2626
throw new InvalidArgumentException('The email address is invalid.');
2727
}
2828

tests/Unit/Value/EmailTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function testWithInvalidValue(string $value): void
3636
public static function validValues(): Iterator
3737
{
3838
yield 'user@example.com' => ['user@example.com'];
39+
yield 'testuserñ@example.com' => ['testuserñ@example.com'];
3940
}
4041

4142
/**

0 commit comments

Comments
 (0)