Popular recipes tagged "meta:requires=xml.sax.saxutils", "web", "security" and "html"http://code.activestate.com/recipes/tags/meta:requires=xml.sax.saxutils+web+security+html/2012-01-10T08:14:14-08:00ActiveState Code RecipesSafe HTML string and unicode (Python)
2012-01-10T08:14:14-08:00Garel Alexhttp://code.activestate.com/recipes/users/2757636/http://code.activestate.com/recipes/578008-safe-html-string-and-unicode/
<p style="color: grey">
Python
recipe 578008
by <a href="/recipes/users/2757636/">Garel Alex</a>
(<a href="/recipes/tags/html/">html</a>, <a href="/recipes/tags/security/">security</a>, <a href="/recipes/tags/web/">web</a>).
Revision 2.
</p>
<p>As you display message on a web page, you have to sanitize input data coming from users to avoid <a href="https://en.wikipedia.org/wiki/Cross-site_scripting">XSS</a>. Here is a small recipe where we can use a special class for our string to be sure we get safe all the way long.</p>