HTML Purifier - Filter your HTML the standards-compliant way! PHP library for whitelisting certain HTML, protecting against XSS, etc. (via @simonw)