Trailing non-breaking space is valid?
Opened this issue ยท 1 comments
dmaicher commented
First of all thanks for maintaining this nice library ๐
I'm using it on my Symfony app in strict
mode (which uses NoRFCWarningsValidation
).
I noticed from time to time my postfix service on prod has some issues with email addresses that passed the validation. In those cases I have trailing non-breaking spaces.
I'm not that familiar with all the RFC specs out there around email address syntax ๐
So I'm wondering: should those be valid? ๐ค
Reproducer:
<?php
require_once 'vendor/autoload.php';
use Egulias\EmailValidator\EmailValidator;
use Egulias\EmailValidator\Validation\NoRFCWarningsValidation;
$validator = new EmailValidator();
var_dump($validator->isValid('some@email.com'.mb_chr(0xA0), new NoRFCWarningsValidation())); //true
var_dump($validator->isValid('some@email.com ', new NoRFCWarningsValidation())); // false