FalseVinylShrub has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I'm writing a site using catalyst, as a learning experience (though I hope something useful will come out of it eventually).
There is going to be user-submitted content and I want to allow formatting. I'm currently using Markdown but planning to allow a limited set of HTML to be entered too.
So rather than create my own html sanitising code, I looked through CPAN. I decided to use HTML::Defang as it looks the most thorough but I can't find much information about how it's been kept up to date. Does anyone know anything better, and is there a project to keep such things up to date in Perl?
There seem to be quite comprehensive and busy projects for similar things in PHP (HTML Purifier), Java and .NET (AntiSamy).
What does PerlMonks use? What do you use? At what point in the process do you sanitise the HTML?
I'm still reading through various resources such as ha.ckers.org/xss.html and it's definitely a complex topic...
Thanks in advance,
FalseVinylShrub
Disclaimer: Please review and test code, and use at your own risk... If I answer a question, I would like to hear if and how you solved your problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML cleanup of user submitted content
by zentara (Cardinal) on Jan 08, 2010 at 16:35 UTC | |
|
Re: HTML cleanup of user submitted content
by GrandFather (Saint) on Jan 08, 2010 at 21:43 UTC | |
|
Re: HTML cleanup of user submitted content
by Herkum (Parson) on Jan 08, 2010 at 20:14 UTC | |
|
Re: HTML cleanup of user submitted content
by FalseVinylShrub (Chaplain) on Jan 18, 2010 at 07:27 UTC |