Formit email validation fails if email address includes an apostrophe [single quote]

According to RFC 3696 - apostrophes are valid characters in an email address, at least before the @ sign.

Formit’s email validation appears to disagree and flags such an address as invalid.

I think the relevant file / line might be:

assets/core/components/formit/src/FormIt/Validator.php - Line 430:

$pattern = "^(([A-Za-z0-9!#$%&'*+\/=?^_`{|}~-][A-Za-z0-9!#$%&'*+\/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$";

This stuff hurts my head but it kind of looks like it should allow the ’ symbol.

This site does use Formalicious to manage the forms but I think the validation comes from Formit.

I can’t see this issue popping up very often but I have a client who’d like to have it fixed.

Any thoughts gratefully received!

MODX 2.8.4-pl Formit 4.2.7-pl PHP 8.1.6

Is this the same problem as in this topic?

1 Like

It is Harry. I did search but didn’t see that!

Thank you so much, problem solved.

I’ll add this as an issue on Github if it’s not there already.