-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] add domain test for windows check dns #27559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Validator] add domain test for windows check dns #27559
Conversation
Looks like this broke some tests. |
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 file mode change must be reverted.
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.
@fabpot sure. I will look at how to improve this request.
|
||
$constraint = new Email(array( | ||
'message' => 'myMessage', | ||
'MX' === $type ? 'checkMX' : 'checkHost' => true, | ||
)); | ||
|
||
$this->validator->validate('[email protected]', $constraint); | ||
$this->validator->validate('foo@another-example.com', $constraint); |
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.
example.com.com is valid but test want violation. I continue to investigate
The file mode still needs to be reverted. Also, I'm not sure I understand the bug. Can you give us an example were your fix would be needed? |
The problem is related to this note in checkdnsrr php doc : http://php.net/manual/fr/function.checkdnsrr.php#119969 I attach a screenshot of results that are different depending on the server The majority problem for me is that email@gmailcom returns true (actually it tests gmailcom.com). |
Do you need more information @fabpot ? |
Hi. When are you gonna look? Thanks a lot ! |
Reading the comment in the docs wouldn't a better fix be to append a dot to the hostname when calling |
Suggestion from @xabbuh sounds good, but I don't think it will work on Linux. We should try. |
I tested it but it doesn't work on windows. The best solution for me is to validate a parsed domain and it's faster. |
I'm still 👎 for this change. Email validation is complex (see the various PRs on this topic) and opinionated. And I would not recommend anyone to use these options anyway, so I propose to instead deprecate checkMX and checkHost and remove them in 5.0. |
…alidator (fabpot) This PR was merged into the 4.2-dev branch. Discussion ---------- [Validator] Deprecate checkMX and checkHost on Email validator | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | fixes #27559 fixes #28665 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- c6009a0 [Validator] deprecate checkMX and checkHost on Email validator
Bug fix compatibility windows RFC on Email validation
RFC windows check host gmailcom as gmailcom.com so its ok but is not..