Should I allow underscores in first and last names?

We have a form that has fields for the first and last name. I was asked to allow underscores. I don’t know a single SQL injection that uses underscores, but I also don’t know anyone with underscores in their name. Is there a good reason to allow or not allow underscores in names?

EDIT: I am using parameters and server side validation. This is for client-side validation through the jQuery validation plugin.

EDIT 2: I didn’t mean it would become a discussion about whether I should do any checks ... I just wanted to know if there is any good reason to accept underscores, for example, I have to accept Irish people or hyphen. Based on this, I accept Oren's answer.

+5
source share
6 answers

You should be as liberal as possible in what you allow as a name. There is no good reason to prohibit underlining, so why do this? There are many horrible stories of people trying to use software that prohibits their actual name. See Falsenesss Believe About Names Programmers for assumptions you should not make.

+14
source

DO NOT PREVENT SQL INTEGRATION USING WHITELISTS!

Will you still meet O'Neill?

Use options instead.

,


Re: EDIT:
​​ .
, --'!@--_.
, .

+12

. sql escape- , . , .

+3

(O'Reilly, Double-Barrel). .

+2

SQL-, ..

'? , '?

+1

, , () " "?

- , , .

+1

All Articles