News for hackers. Stuff that matters.
Re:PHP: The Right Way by prodigal_erik on Saturday July 07, 2012 @08:04PM (#4213100)
If I want to tweet

  I <3 O'Reilly books
you could pre-encode that as safe to paste into raw SQL, or as well-formed (X)HTML, but you can't do both simultaneously. Either encoding would end up distorting the content in the other context. You have to encode during output (and writing to a database counts) using the rules of the system consuming that output. Lots of crappy web forums visibly mangle punctuation in a futile effort to avoid this.
Re:PHP: The Right Way by MartinCron on Sunday July 08, 2012 @07:29PM (#4216053)
What a great example. I am going to remember that one.