Allow Whitelisted HTML Class
Posted: Thu Apr 06, 2006 4:56 pm
'Ello,
I'm in need of a class which:
- allows only whitelisted HTML in a string
- replaces < and > with their html entities for tags that aren't whitelisted
- strips out attributes and the attributes' values if the attributes aren't whitelisted for that particular tag
- is preferably OO and unit tested
I searched through phpClasses, but didn't find one that met any of the criteria. Does anyone here know of one, or at least one which meets some of the requirements and I could build the other requirements into?
- Nathaniel
I'm in need of a class which:
- allows only whitelisted HTML in a string
- replaces < and > with their html entities for tags that aren't whitelisted
- strips out attributes and the attributes' values if the attributes aren't whitelisted for that particular tag
- is preferably OO and unit tested
I searched through phpClasses, but didn't find one that met any of the criteria. Does anyone here know of one, or at least one which meets some of the requirements and I could build the other requirements into?
- Nathaniel