开发者

Why are accents accepted in sfValidatorEmail?

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜