I am writing PHP class which have to remove all potentially dangerous elements or bogus html tag (such as bad links)
from HTML source.
Usually I would use HTML Purifier library
or similar library,
but self-written code is required in this project.
There are two conditions:
I wrote something that could do the job: http://pihost.pl/purify.php
but i do not know if it is safe enough to use
My question is:
Is there any way to test it properly?
Or maybe someone has quick, small and tested library like this?
An important thing to consider -- how does your purifier react to broken/malformed HTML? To combat that situation, I would suggest running it through PHP tidy first to clean up the HTML, before you purify it.
If you want a series of tests, you can try checking out the tests that HTMLPurifier uses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With