View Single Post
Old 01-10-2013, 10:20 PM   PM User | #11
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,452
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by sbhmf View Post
I suppose one issue under discussion is whether or not encoding the HTML on the client prior to uploading it is sufficient to inhibit scripting attacks
NEVER encode HTML when it is input - that would make it unusable for any purpose other than displaying in an HTML page. The time to encode HTML is when actually adding it to an HTML web page that you want to display it.

For example: You would save the < characters as < in the database and only convert them to &lt; when outputting HTML.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote