3 ms·
This is a great resource, but some of the input validation stuff doesn't sit well with me, for example: > Examples of Good Input Validation Approaches... First
by georgefox 15y ago
This is a great resource, but some of the input validation stuff doesn't sit well with me, for example:
> Examples of Good Input Validation Approaches... Firstname: Letters, single apostrophe, 1 to 30 characters
First, I'm not sure if I should interpret letters as [A-Za-z] or something more inclusive of non-Latin characters. But anyway, why restrict this so much? What about spaces, as in Mary Ellen; dots, as in P.J.? Heck, why can't I use a hyphen or a number? Just because you might not try to name your kid Brfxxccxxmnpcccclllmmnprxvclmnckssqlbb11116 doesn't mean nobody else will (http://en.wikipedia.org/wiki/Naming_law_in_Sweden#Protest_names http://en.wikipedia.org/wiki/Naming_law_in_Sweden#Protest_na...).
Perhaps I'm not seeing the forest for the trees here, but when it comes to restricting input, it always seems there's a risk of "We can not accept that last name" behavior (http://www.cooper.com/journal/2009/09/we_cannot_accept_that.html http://www.cooper.com/journal/2009/09/we_cannot_accept_that....). If you're properly sanitizing/escaping on the way out, why be so harsh on the way in?