Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Closed
wants to merge 9 commits into from
Closed

[Validator] add domain test for windows check dns #27559

wants to merge 9 commits into from

Conversation

beebop1032
Copy link

Q A
Branch? 2.8
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Bug fix compatibility windows RFC on Email validation
RFC windows check host gmailcom as gmailcom.com so its ok but is not..

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jun 8, 2018

Looks like this broke some tests.

Copy link
Member

@fabpot fabpot left a 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.

Copy link
Author

@beebop1032 beebop1032 left a 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);
Copy link
Author

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

@fabpot
Copy link
Member

fabpot commented Jun 11, 2018

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?

@beebop1032
Copy link
Author

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).

checkdns

@nicolas-grekas nicolas-grekas changed the title add point on host for windows check dns [Validator] Add dot on host for windows check dns Jun 14, 2018
@beebop1032 beebop1032 changed the title [Validator] Add dot on host for windows check dns [Validator] add domain test for windows check dns Jun 19, 2018
@beebop1032
Copy link
Author

Do you need more information @fabpot ?

@beebop1032
Copy link
Author

Hi. When are you gonna look? Thanks a lot !

@xabbuh
Copy link
Member

xabbuh commented Jul 10, 2018

The problem is related to this note in checkdnsrr php doc :

http://php.net/manual/fr/function.checkdnsrr.php#119969

Reading the comment in the docs wouldn't a better fix be to append a dot to the hostname when calling checkdnsrr()?

@fabpot
Copy link
Member

fabpot commented Jul 18, 2018

Suggestion from @xabbuh sounds good, but I don't think it will work on Linux. We should try.

@beebop1032
Copy link
Author

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.

@fabpot
Copy link
Member

fabpot commented Aug 2, 2018

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.

@beebop1032 beebop1032 closed this Aug 4, 2018
fabpot added a commit that referenced this pull request Oct 12, 2018
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants