Skip to content

Commit

Permalink
Merge pull request #14 from nymo/extend-validation-regexp
Browse files Browse the repository at this point in the history
extend-validation-regexp
  • Loading branch information
naucon committed May 8, 2023
2 parents 31b4e33 + 47df340 commit c8948f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/Validator/Constraints/IsEmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
*/
class IsEmailValidator extends ConstraintValidator
{
/**
* @var string
*/
const REGEXP = '/^([a-zA-Z0-9_\-\+]+(?:\.[a-zA-Z0-9_\-\+]+)*\@([a-zA-Z0-9\-\+]+\.?)+[a-zA-Z0-9]{0,10},?)+$/D';
const REGEXP = '/^(?![.-])([a-zA-Z0-9_\-\+]+(?:\.[a-zA-Z0-9_\-\+]+)*\@([a-zA-Z0-9\-\+]+\.?)+[a-zA-Z0-9]{0,10},?)+$/D';

/**
* {@inheritdoc}
Expand Down
1 change: 1 addition & 0 deletions tests/Validator/Constraints/IsEmailValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function valueProvider()
['[email protected] <Your Name>', false],
['[email protected]', false],
['[email protected]', false],
['[email protected]', false],
[0, false],
[1, false],
[2.95, false],
Expand Down

0 comments on commit c8948f7

Please sign in to comment.