HTBox / allReady

This repo contains the code for allReady, an open-source solution focused on increasing awareness, efficiency and impact of preparedness campaigns as they are delivered by humanitarian and disaster response organizations in local communities.
http://www.htbox.org/projects/allready
MIT License
891 stars 627 forks source link

First and last name validation #2249

Closed dracan closed 6 years ago

dracan commented 6 years ago

When trying to register a new user, the registration form fails ...

image

Looking at the code, the AllReady.ViewModels.Account.RegisterViewModel has this regular expression ... (.*?)\s([\wáâàãçéêíóôõúüÁÂÀÃÇÉÊÍÓÔÕÚÜ]+\-?\'?\w+\.*?$), which seems to have been added in #2148. Not sure this is right.

redware commented 6 years ago

I am getting this error too.

thelem commented 6 years ago

I'll pick this up

thelem commented 6 years ago

The current regular expression (as quoted by @dracan above) looks for: any character, followed by whitespace, followed by at least one letter or number including accented letters, followed by some optional special characters, followed by white space, followed by optional periods.

I've changed it so that it looks for at least one letter (including the same accented letters), number or a small list of special characters (hyphen, apostrophe, period, comma, space) and made sure there are no characters before or afterwards.