-
Notifications
You must be signed in to change notification settings - Fork 136
Conversation
@@ -741,8 +741,8 @@ public function testUseMxCheckBasicValid() | |||
]; | |||
|
|||
if (extension_loaded('intl')) { | |||
$emailAddresses[] = 'иван@письмо.рф'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why modify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current validator only accepts RFC 5321 email addresses (atext = ALPHA / DIGIT / "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~"). Because of the wrong use of IDNA for local parts, validate() returned false positives for local parts with unicode characters. When we implement RFC 6532 #3.2 the user should be able to choose if he wants to validate against RFC 5321 or RFC 6532 because SMTPUTF8 is not yet widely supported and just an extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is a breaking change, as you said an option should be implemented for choose what rules should be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. But this is part of another PR to make this validator RFC 6532 compatible (coming soon).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please place those values which you consider invalid in the appropiate test (testUseMxRecordsBasicInvalid)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some tests for valid/invalid emails.
7ac58a8
to
b22f7d6
Compare
Depends on /pull/67. Merge that one first. |
|
||
if (extension_loaded('intl')) { | ||
$return['bob@موقع.إختبار'] = ['bob@موقع.إختبار']; | ||
$return['bob@xn--4gbrim.xn--kgbechtv'] = ['bob@xn--4gbrim.xn--kgbechtv']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged #67 at this point, and just attempted to merge this PR. When running tests, both of these specific cases fail, each with:
not a valid hostname for the email address
The input appears to be a DNS hostname but cannot match TLD against known list
The input appears to be a local network name but local network names are not allowed
Failed asserting that false is true.
I'm not sure if that's expected at this point, and you have more work to do, or if there's another, more subtle issue.
@weierophinney I used a IANA test TLD in this test, but Hostname validator does not accept any of these. Could have tested it by myself first... sorry :/ |
See:
zendframework/zend-mail/issues/49