Hacker News new | ask | show | jobs
by trilila 2530 days ago
Correct. And one reason to properly format for output, rather than sanitise input is because you do not know how the string might be used. I mean you can sanitise for HTML output, but it won't cover shell command output (i.e.: when you pass the string as a parameter to a tool via --vehicle-name=). Thus input is to be stored as is, and NEVER trusted even if some input sources "sanitise" it.
1 comments

this mistake is what causes the incredibly common html entities in plain-text emails, as well as RSS article titles.