There was a bug in my application, apparently accent开发者_高级运维s in an email address where not considered an error and the sfMailer
was crashing an error because of this.
Digging through my code I realized I wasn't to blame.
sfValidatorEmail
uses this regular expression:
const REGEX_EMAIL = '/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i';
Accents in the first part of the email are accepted.
Should sfValidatorEmail
not accept accents or should sfMailer
accept it?
sfMailer should accept it. It is legitimate to have accents in the first part of the email address.
According to wikipedia accents are valid. Off course, in practice, in webprogramming, I try to avoid anything (spaces, accents,...) that can upset the 'internet middle layer' (i.e. routers, servers, etc).
精彩评论