![]() |
HTML tags
I'm about to start writing a class for performing HTML cleanup and perhaps validation. Before doing that, however, I'd like to know if there is already some PHP extension that could do that. It would be easier, as well as faster. If not, could you perhaps give me some advice on the implementation? I mean, replacing ALL tags would be a relatively easy task. But how about removing all tags that are not in a set of allowed tags?
PS: please don't give me the strip_tags function. I know it's there, but I'd rather not use it. It has its flaws, I've experienced some with it and I've seen others have problems with it. |
For validation I believe WC3 has an pear API you could look at, don't exactly know the link to it though.
|
The biggie in this field would be Tidy for "HTML cleanup". There's also HTML Purifier (fairly new, PHP5) if you're looking more towards filtering, XSS prevention and so on.
For the W3C validation using PEAR that TicAndres mentioned, there's: Servies_W3C_HTMLValidator |
Thanks Salathe, I'll look into HTML Purifier. I've heard about it some time ago, but forgot about it. Its features sound good. And I wouldn't have to write a library myself.
|
| All times are GMT. The time now is 08:31 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0