Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Then what if someone starts putting in unicode control characters? What if you display their name as the title of a window and they made their name start with two right to left control marks, causing Windows to invert the entire window contents?


names are no different from any other form of user input in this regard. Any time you include user input in a document you should follow it with a direction override character to restore the text direction, just in case the user changed it. You could also strip these characters out, but some people really do want their name to show up backwards, and for that to be consistent across all cases.


For specific uses (like output to html), you will have to escape the content, as with any other content, but you can store what the user input.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: