core icon indicating copy to clipboard operation
core copied to clipboard

dotCMS rejects valid email addresses for users

Open cmaessen opened this issue 10 years ago • 6 comments

If you create a user with an email address that looks like this:

O'[email protected]

DotCMS will display the error message that this isn't a valid email address. This is caused by the ' character in the email address. But according to RFCs for email this is a valid character for the local part of an email address.

See the following Wikipedia page for a summary of valid characters: https://en.wikipedia.org/wiki/Emailaddress#Localpart

cmaessen avatar Jul 01 '16 09:07 cmaessen

I now also noticed that the last name field doesn't accept single quotes in names like O'Connell. It then shows the error "Last Name not valid".

cmaessen avatar Jul 18 '16 07:07 cmaessen

First Name/Last Name accepted characters was addressed here: https://github.com/dotCMS/core/issues/8750

Leaving this one open for the email address validation

dsilvam avatar Jul 18 '16 13:07 dsilvam

Client with the issue of single quote in the email address https://my.dotcms.com/tickets/detail.dot?id=1f5d9efb-728a-40aa-8030-cb0f0db6c85f

There is two places where this needs to be changed: https://github.com/dotCMS/core/blob/master-3.6/dotCMS/html/portlet/ext/useradmin/view_users_js_inc.jsp#L419 and https://github.com/dotCMS/core/blob/master-3.6/src/com/liferay/util/Validator.java#L224

Also as an enhancement create a property, as the one for the username, to validate this.

erickgonzalez avatar Sep 09 '16 18:09 erickgonzalez

In 4.1.1, When you use the My Account feature, apostrophes are not allowed in the email address field and the error message that appears shows as "{0} is an invalid E-mail Address."

davwil00 avatar Oct 06 '17 08:10 davwil00

PR: https://github.com/dotCMS/core-web/pull/443

erickgonzalez avatar Oct 09 '17 20:10 erickgonzalez

Passed QA. Tested apostrophe in email address and it allowed to login. System is also accepting apostrophe in first name/last name. No errors in logs Tested on master branch / commit 0749f1057e0019dd5c94aa31a9f007d3194ee5aa Ubuntu 14.04.1 / Postgres 9.3.7 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8

shaydotcms avatar Oct 18 '17 16:10 shaydotcms