New answers tagged

1

"Your password must be a minimum of 8 characters long and may contain any standard alphanumeric character or the following symbols: ! # %" (There may be symbols that are ASCII characters but that you may want to restrict people from using in their password to address things like cross-site-scripting vulnerability. Providing a list of green-lit symbols is ...


1

Something like the below will be intelligible to most users. You may only use the characters A to Z, 0 to 9, and simple punctuation in your password. The key is to only show it when they try to add a non-ASCII character. That way any user who tries to use a character in the ASCII set but not in that description will be fine, and won't even see that ...


1

Sanitizing user input doesn't imply you change or restrict input, it simply means you handle it safely and escape it when necessary to prevent exploits like XSS attacks. If you're saving the data to a database, use parameterized queries. Even if your specific database doesn't support them directly, often times many libraries can add a simple wrapper over ...


0

how to sanitize user input for data fields such as the name Either Don't. If you are worried about SQL injection, use parameterised queries instead. Use appropriate Unicode character classes. For example see Java regex for support Unicode?: \p{L}+.


2

Be careful of using methods that would prevent some of your users from entering their actual names. Names are extremely personal and being told 'you can't use your real name' isn't going to sit well with everyone. I remember dealing with a customer at least once a month who was upset that she couldn't use her hyphenated name (this was a rarely-accessed ...


-3

Look in to commonly used allowed formats and symbols for text input. For example, email allows A-Z, a-z, 1-0 and !#$%&'*+-/=?^_`{|}~. Domain names on the other hand only allow A-Z, a-z, 1-0 and hyphens. There isn't a simple end-all solution for user input. It's highly dependent on context. What are they filling in, how are they filling it in, where are ...



Top 50 recent answers are included