Does it do automatic contextual escaping to avoid XSS attacks like the standard library's html/template system does?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
PHP's magic quotes are the most infamous example of the pitfalls of automatic escaping applied too liberally.
Call me an old curmudgeon, but my experience has dictated that you don't trust user input and you be carefulwhen outputting something you got from the user. PHP's magic quotes are the most infamous example of the pitfalls of automatic escaping applied too liberally.to quote "The very reason magic quotes are deprecated is that a one-size-fits-all approach to escaping/quoting is wrongheaded and downright dangerous." -- Some random internet dudeIt's possible I'm missing something here and that "contextual" escaping avoids these pitfalls. It seems to be that parsing the text your outputting as HTML is a an unnecessary responsibility to add to a text templating language.
"PHP is totally broken in myriad ways. It is best ignored." Those who ignore the past are doomed to repeat it.
Well, gosp is out there, it's fast, and it will let you shoot yourself in the foot if that's where you point the gun. I could always be wrong. Shrug.
I should read more of the html template source. Figuring out whether the fragment you are rendering is html4,html5, XHTML, an attribute, style, or script sounds pretty daunting. Props to whoever figured out all the edge cases there.