• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what characters to filter?

 
Trailboss
Posts: 23778
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm writing some servlet and jsp stuff and am just now sitting down to write some code that will filter what goes into my fields.
For example, any time double quotes are used, I want to replace them all with """. I'm thinking that I might want to do similar things with ampersands, less than signs and greater than signs. Maybe other stuff.
Anybody have a list of the stuff I should look for and what I should convert it to?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends on what you are trying to do!
this forum filters out every god-for-saken javascript function! PO me and all of the rest of the people here!
A good thing is just to unescape a line in my mind
changes spaces to %20 and other signs
<script>
TheText="The Text Goes Here: ' says the man' & hmm do not forget the cheese!~~>Dumb<~~"
Output=unescape(TheText);
alert(Output);
alert(escape(Output));
</script>

The biggest things are < > & '
Eric
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic