Skip to content

Commit

Permalink
Email validation messages simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
escopecz committed May 30, 2017
1 parent 4fd90fd commit ee599fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/bundles/EmailBundle/Helper/MailHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1256,15 +1256,14 @@ public static function validateEmail($address)

if ($invalidChar !== false) {
throw new \Swift_RfcComplianceException(
'Address in mailbox given ['.$address.
'] contains the invalid character: '.substr($invalidChar, 0, 1)
'Email address ['.$address.
'] contains this invalid character: '.substr($invalidChar, 0, 1)
);
}

if (!filter_var($address, FILTER_VALIDATE_EMAIL)) {
throw new \Swift_RfcComplianceException(
'Address in mailbox given ['.$address.
'] does not comply with RFC 882'
'Email address ['.$address.'] is invalid'
);
}
}
Expand Down

0 comments on commit ee599fb

Please sign in to comment.