You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
The problem occurs when the user enters an email with UTF-8 characters in the local part.
Here is an example: тест@example.com
While debugging, Zend\Validator\EmailAddress::validateLocalPart() returns (boolean) true, thus causing the input to be valid (but it isn't).
Afterwards, sending an e-mail is impossible, because тест@example.com gets into the e-mail headers and they become invalid.
I have investigated the problem and it turns out that $this->idnToAscii($this->localPart) in the Zend\Validator\EmailAddress::validateLocalPart() method is causing the problem. It converts all UTF-8 characters to ASCII and makes the preg_match. It returns true and voila - wrong validation.
The text was updated successfully, but these errors were encountered:
Sorry, I'm not 100% clear on the problem: is it that тест@example.com is being accepted by the validator when you think it shouldn't? Or is the problem in sending an email to that validated address?("Afterwards, sending an e-mail is impossible...")
If it's the former, UTF-8 characters above U+007F are technically allowed in the email address local part (RFC 6531) though I don't know anything about specific implementations and what they do or don't accept.
I thought that the validator should not accept UTF-8 characters in the local part at all.
Maybe I was wrong.
However, there is a problem afterwards when sending the e-mail.
The headers seems to be invalid.
Because of the invalid headers I thought that the validator is not working right.
Here is the usage of the validator in the form:
The problem occurs when the user enters an email with UTF-8 characters in the local part.
Here is an example:
тест@example.com
While debugging,
Zend\Validator\EmailAddress::validateLocalPart()
returns(boolean) true
, thus causing the input to be valid (but it isn't).Afterwards, sending an e-mail is impossible, because
тест@example.com
gets into the e-mail headers and they become invalid.I have investigated the problem and it turns out that
$this->idnToAscii($this->localPart)
in theZend\Validator\EmailAddress::validateLocalPart()
method is causing the problem. It converts all UTF-8 characters to ASCII and makes the preg_match. It returns true and voila - wrong validation.The text was updated successfully, but these errors were encountered: