HTML Purifier 
Version
0.3 (last update on Apr 28, 2009)
Rating
Compatibility
Votes
13
Favoured
16
License
GPL
Non-Commercial
Type
Views
21087
Date Added
9 February 2008
I will try to spend some time soon updating the library version.
--------
This plugin is based on the HTML Purifier library ( http://htmlpurifier.org/ ), and has been ported to joomla by http://www.joomlashow.it/ staff.
This plugin purifies html code of contents to gain valid XHTML.
It's just 0.2 version but we want to make a well-working extension, our goal is to make possible a total xhtml 1.0 strict compliance with joomla 1.5.
We need help testing and getting feedback.
There are 4 versions available:
Html purifier Mambot - Joomla 1.0 - PHP 4 based on 2.1.3 version of the HTML Purifier library;
Html purifier Mambot - Joomla 1.0 - PHP 5 based on 3.0 version of the HTML Purifier library;
Html purifier Plugin - Joomla 1.5 - PHP 4 based on 2.1.3 version of the HTML Purifier library;
Html purifier Plugin - Joomla 1.5 - PHP 5 based on 3.0 version of the HTML Purifier Library;
Plugin allows configuration of the following parameters:
Tidy Level: High, Medium, Heavy;
Doctype: Xhtml 1.0 Transitional, Xhtml 1.0 strict, Html 4.0 Transitional, Html 4.0 Strict;
Linkify: converts automatically every strings http: // in a link.
Trusted HTML: if setted "no" it doesn't permit to use script and style tags.
Proprietary CSS (PHP 5 only): if setted "on" permits to use of non standard css properties.
If you have some problems in a particular content item you can deactivate the plugin simply writing {disablepurifier}.
And don't forget to thank Edward Z. Yang for the library!
ADD:
Thank you for your appreciation.
I noticed a little problem on a site of mine, the plugin cutted the apostrophes, but really don't know why only on that site.
Anyway if you find problems please report!
This module is Joomla 1.5 also compatible.
bySilvioDante on October 3, 2009
This extension does purify the HTML so that it passes the W3C HTML validator but in the process it disables the Highslide JS image viewer.
When you enable the HTML purifier and click the thumbnails they open in an old fashioned way and no longer in a lightbox.
You can, however, add the {disablepurifier} in "classes" of the images advanced tab in the image editor but this is not a good fix as it would require me to go through hundreds of images and in addition the website will no longer pass the W3C validator.
When you enable the HTML purifier and click the thumbnails they open in an old fashioned way and no longer in a lightbox.
You can, however, add the {disablepurifier} in "classes" of the images advanced tab in the image editor but this is not a good fix as it would require me to go through hundreds of images and in addition the website will no longer pass the W3C validator.
bywestbywest on September 8, 2009
I was able to fix the problem described above with HTML purifier plugin stripping anchor links.
This involved swapping out the "library" folder in the htmlpurifier plugin directory tree with that found in v3.3.0 of HTML Purifier Lite, available here:
http://htmlpurifier.org/releases/
The required additions to htmlpurifier.php are described below:
http://htmlpurifier.org/phorum/read.php?3,2720
In particular you need to add these lines before the line "purifier = new HTMLPurifier($config);"
// retain anchor links
$config->set('HTML', 'DefinitionID', 'enduser-customize.html tutorial');
$config->set('HTML', 'DefinitionRev', 1);
$def = $config->getHTMLDefinition(true);
$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
Also, to avoid some PHP warnings, you will need to change these lines in htmlpurifier.php:
$config->set('Core', 'DefinitionCache', null);
$config->set('HTML', 'EnableAttrID', true);
To these, respectively:
$config->set('Cache', 'DefinitionImpl', null);
$config->set('Attr', 'EnableID', true);
This involved swapping out the "library" folder in the htmlpurifier plugin directory tree with that found in v3.3.0 of HTML Purifier Lite, available here:
http://htmlpurifier.org/releases/
The required additions to htmlpurifier.php are described below:
http://htmlpurifier.org/phorum/read.php?3,2720
In particular you need to add these lines before the line "purifier = new HTMLPurifier($config);"
// retain anchor links
$config->set('HTML', 'DefinitionID', 'enduser-customize.html tutorial');
$config->set('HTML', 'DefinitionRev', 1);
$def = $config->getHTMLDefinition(true);
$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
Also, to avoid some PHP warnings, you will need to change these lines in htmlpurifier.php:
$config->set('Core', 'DefinitionCache', null);
$config->set('HTML', 'EnableAttrID', true);
To these, respectively:
$config->set('Cache', 'DefinitionImpl', null);
$config->set('Attr', 'EnableID', true);
Owner's reply
Thank you very much, there is something i didn't understand properly, can i contact you in private to ask you some questions?
byAmitT on January 19, 2009
I did some mistakes with the xhtml code of my site, but this plugin fixed it and the site passed the w3 validator anyway.
bydeyraud on May 25, 2008
Good plugin, however I have one problem before I can start using it... It strips the name attribute from my anchors, therefore.. no document anchors and #refs :(
My poor FAQ...
I've tried switching the purify to light mode with XHTML 1.0 Transitional and it still strips name from the anchor.
My poor FAQ...
I've tried switching the purify to light mode with XHTML 1.0 Transitional and it still strips name from the anchor.
bybob2006 on April 3, 2008
All this needs now is to be integrated with PHPIDS, have setting to add forum, and comment boxes, etc., to be checked/sanitized and I think we have a winner.
Good work, I appreciate the effort to get this going.
Good work, I appreciate the effort to get this going.
byelpaso on April 2, 2008
This was the missing piece, I wrote an accesskey component and an accessible template, but com_content is too messy with pagebreaks and readmore code and with this plugin I finally have a 100% XHTML strict code.
bylipex666 on February 11, 2008
I can now load YouTube vids all over my site anywhere anytime.
Can cut and past all sorts of java and html.
Thank you.
Can cut and past all sorts of java and html.
Thank you.







