I want to provide an HTML editor on my site, but I do not want to open myself up to xss or other attacks that come with custom HTML.
This is very similar to what Stack Overflow does. How HTML is checked / cleared here, so that styling information remains, while other, more dangerous things (such as javascript, iframe, etc.) are not used?
Are there any libraries (preferably in PHP) that already do this?
source share