[BNM] HTML Sanitation in PHP

AndrewGill73@gmail.com andrewgill73 at gmail.com
Tue May 26 14:27:04 BST 2009


Leo,
Hello. If I understand you correctly I think this might help:

http://htmlpurifier.org/

It is a php library that validates html, it looks very good although I've
not had an opportunity to use it myself yet. Also It looks like there is a
wordpress plug-in which might also help.

Good luck.

Cheers,
Andy Gill
www.andrewgill.com


2009/5/26 Leo Brown <lists at acumendevelopment.net>

> Guys
>
> Very close to releasing a site but there's a blocker involving
> Wordpress/TinyMCE allowing invalid HTML.
>
> Basically, we have a process whereby the contents of a page are loaded into
> a tab. If the HTML is invalid (lets say more close tags than open) then the
> result is the tab finishes early, and the content spills out.
>
>  See http://proto.peacedirect.org/peacebuilders/cpau/
>
> The text starts flowing out underneath the table due to an extra </div>
> from
> TinyMCE. A really clunky solution would be to use IFRAMEs, but I'm looking
> for some sort of sanitisation approach. I know I can load HTML into
> DOMElement, but I am assuming that the saveXML() function will return it to
> me with 'bad' tags intact.
>
> Any ideas?
> Leo
>
> --
>
> BNM Subscribe/Unsubscribe:
> http://www.brightonnewmedia.org/options/bnmlist
>
> BNM powered by Wessex Networks:
> http://www.wessexnetworks.com
>


More information about the BNMlist mailing list. Powered by Wessex Networks