1
2
3
4
#!/usr/bin/php
<?php
/**
...

PHP HTML Filter

by grom, October 23, 2008 23:00, 1 refactoring, tagged with php, html, parser, sanitize

Only allow subset of HTML. ...

A14537020ec5b11fea3b956353724860 Talk
1
2
3
4
private static Regex _tags = new Regex("<[^>]*(>|$)", RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
private static Regex _whitelist = new Regex(@"
    ^</?(a|b(lockquote)?|code|em|h(1|2|3)|i|li|ol|p(re)?|s(ub|up|trong|trike)?|ul)>$
...

C# Sanitize HTML

by Jeff Atwood, June 20, 2008 08:24, 54 refactorings, tagged with xss, sanitize, html

Takes a provided HTML strin...

51d623f33f8b83095db84ff35e15dbe8 Talk