Skip to content

[Validator] EmailValidator cannot extract hostname if email contains multiple @ symbols #18147

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 2 commits into from

Conversation

natechicago
Copy link
Contributor

Q A
Branch 2.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18146
License MIT
Doc PR n/a

@javiereguiluz
Copy link
Member

@natechicago thanks for contributing this fix. As a very minor comment, next time is enough to include the fixed ticket number in the table and prefix it with # so GitHub turns it into a link. Thanks!

@sstok
Copy link
Contributor

sstok commented Mar 13, 2016

Please update the tests to ensure will not break in the future 👍

Status: needs work

@natechicago
Copy link
Contributor Author

@javiereguiluz thanks for the tip! @sstok I've added an appropriate unit test to make sure this problem won't recur in the future.


$this->assertEquals(
$hostnameAndEmail[0],
$method->invokeArgs($this->validator, [$hostnameAndEmail[1]])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we need to support PHP 5.3 we cannot use the short array syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, force of habit! I've updated this line to use array() instead.

@nicolas-grekas
Copy link
Member

checkdnsrr mocking implemented in #18181
I propose to rebase on top of it once it's merged

@nicolas-grekas
Copy link
Member

@natechicago your turn

@natechicago natechicago force-pushed the 18146-email-validator branch 2 times, most recently from aed6486 to 8bcfd27 Compare March 17, 2016 02:49
@natechicago
Copy link
Contributor Author

@nicolas-grekas Since the new unit test depends on PHPUnit Bridge, should this PR (targed against 2.3) be closed and a new one opened against 2.7?

http://symfony.com/blog/new-in-symfony-2-7-phpunit-bridge

@natechicago natechicago force-pushed the 18146-email-validator branch from 8bcfd27 to eabe394 Compare March 17, 2016 02:58
@nicolas-grekas
Copy link
Member

The bridge is used to test 2.3 also so this PR is fine. See my PRs from yesterday

@xabbuh
Copy link
Member

xabbuh commented Mar 17, 2016

@natechicago Can you rebase here please?

@natechicago natechicago force-pushed the 18146-email-validator branch from eabe394 to e64c3bc Compare March 17, 2016 13:08
@natechicago
Copy link
Contributor Author

Thanks guys, this should now be ready to merge.

{
DnsMock::withMockedHosts(array(
'baz.com' => array(array('type' => 'MX')),
'@bar"@baz.com' => array(array('type' => false)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this line: the list of moked hosts is exclusive and a look up for this last host would fail anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K, changes have been pushed.

@nicolas-grekas
Copy link
Member

👍

1 similar comment
@stof
Copy link
Member

stof commented Mar 17, 2016

👍

@stof
Copy link
Member

stof commented Mar 17, 2016

Status: reviewed

@xabbuh
Copy link
Member

xabbuh commented Mar 17, 2016

👍

@nicolas-grekas
Copy link
Member

Thank you @natechicago.

nicolas-grekas added a commit that referenced this pull request Mar 17, 2016
…l contains multiple @ symbols (natechicago)

This PR was squashed before being merged into the 2.3 branch (closes #18147).

Discussion
----------

[Validator] EmailValidator cannot extract hostname if email contains multiple @ symbols

| Q             | A
| ------------- | ---
| Branch        | 2.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18146
| License       | MIT
| Doc PR        | n/a

Commits
-------

c551bd1 [Validator] EmailValidator cannot extract hostname if email contains multiple @ symbols
@fabpot fabpot mentioned this pull request Apr 29, 2016
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.

8 participants