Question

Possible en double: Comment mettre en œuvre vous un bon filtre de jurons?

Je dois prendre un nom de ville des utilisateurs en entrée, mais je ne veux pas accepter de jurons. Quelqu'un peut-il me dire comment je peux empêcher les utilisateurs de taper ces mots?

Était-ce utile?

La solution

You'd have to scan the input for all vulgarity, either post-entry or during the entry, and reject the content then. Inversoft (http://www.inversoft.com/) has a web service available that can help; you can also do a google search for "java profanity filter" to find other similar products.

Autres conseils

  1. Define a list of profanities.
  2. Ask the user for input.
  3. Check the input. If it is equal to any item in your list of profanities, reject it.

Of course users will not be able to enter names of actual cities which are also profanities. By definition, you are excluding such cities.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top