Oggi vediamo un programmino in PHP pronto all’uso che ben si adatta a qualsiasi delle nostre pagine web. It is HTML Purifier a common libreria PHP, that cleans up the HTML dates of the pages by removing all tag e i markup unnecessary, that often weigh down the page. Also makes the code of our pages secure (I'm thinking about dynamic sites: WordPress, Joomla, Drupal, etc..) contrasting effectively XSS attacks (Cross-site scripting).

For those who want to use HTML Purifier hand operation is more than obvious; downloaded and extracted the package we give write permissions the folder /HTMLPurifier/DefinitionCache/Serializer:

chmod 755 /HTMLPurifier/DefinitionCache/Serializer

Now recall the library all’interno della pagina in cui la vogliamo usare

require_once ''

At this point, if properly configured script, the library will be able to parse the pages and return results “filtered“.

But there are shortcuts for those who use the CMS:

Forse rallenterĂ  un poil load della pagina, but it's a risk I'm willing to take if the offset is greater safety.


I keep this blog as a hobby by 2009. I am passionate about graphic, technology, software Open Source. Among my articles will be easy to find music, and some personal thoughts, but I prefer the direct line of the blog mainly to technology. For more information contact me.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.