top | item 45675347

(no title)

jsmith99 | 4 months ago

It's arguably easier just to sanitise at display time otherwise you have problems like double escaping.

discuss

order

bpt3|4 months ago

Easier does not mean better, which seems to be true in this case given the many, many vulnerabilities that have been exploited over the years due to a lack of input sanitization.

padjo|4 months ago

In this case easier is actually better. Sanitize a string at the point where you are going to use it. The locality makes it easy to verify that sanitation has been done correctly for the context. The alternative means you have to maintain a chain of custody for the string and ensure it is safe.