in reply to Re^2: Removing malicious HTML entities (now with more questions!)
in thread Removing malicious HTML entities (now with more questions!)
I don't think it's a good idea to escape the values upon reading them. What if you are gonna need them raw? What if you're gonna need them URL escaped or escaped for inclusion in a JavaScript string literal or or or or.
Besides not all data will come into your script from the form/query so you'll have to either escape everything, no matter where it comes from or keep track of what is and what is not escaped.
Escape before you output, not when you input. Because only at the output do you really know how are you going to know how do you need to escape.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Removing malicious HTML entities (now with more questions!)
by techcode (Hermit) on Aug 17, 2008 at 02:35 UTC |