Skip to content
Snippets Groups Projects
Commit 8fb7b576 authored by ezyang's avatar ezyang
Browse files

Update module for HTML Purifier 4.0.0.

parent 64fa69da
No related branches found
Tags 6.x-2.0
No related merge requests found
* Place the htmlpurifier folder in your drupal modules directory.
* Download HTML Purifier from http://htmlpurifier.org/ You will need
3.1.0rc1 or later.
4.0.0 or later.
* Extract the "library" folder and place it inside your modules/htmlpurifier
directory.
......
......@@ -36,7 +36,7 @@ function htmlpurifier_uninstall() {
*/
function _htmlpurifier_version_check() {
// This version of HTML Purifier is required
static $req_version = '3.1.0';
static $req_version = '4.0.0';
// Can't use drupal_get_path, since module may not have been installed.
$module_path = dirname(__FILE__);
......
......@@ -183,23 +183,23 @@ function _htmlpurifier_get_config($format) {
$config = HTMLPurifier_Config::createDefault();
$config->set('AutoFormat', 'AutoParagraph', TRUE);
$config->set('AutoFormat', 'Linkify', TRUE);
$config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional'); // Probably
$config->set('Core', 'AggressivelyFixLt', TRUE);
$config->set('Cache', 'DefinitionImpl', 'Drupal');
$config->set('AutoFormat.AutoParagraph', TRUE);
$config->set('AutoFormat.Linkify', TRUE);
$config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); // Probably
$config->set('Core.AggressivelyFixLt', TRUE);
$config->set('Cache.DefinitionImpl', 'Drupal');
// Filter HTML doesn't allow external images, so neither will we...
// for now. This can be configured off.
$config->set('URI', 'DisableExternalResources', TRUE);
$config->set('URI.DisableExternalResources', TRUE);
if (!empty($_SERVER['SERVER_NAME'])) {
// SERVER_NAME is more reliable than HTTP_HOST
$config->set('URI', 'Host', $_SERVER['SERVER_NAME']);
$config->set('URI.Host', $_SERVER['SERVER_NAME']);
}
if (defined('LANGUAGE_RTL') && $GLOBALS['language']->direction === LANGUAGE_RTL) {
$config->set('Attr', 'DefaultTextDir', 'rtl');
$config->set('Attr.DefaultTextDir', 'rtl');
}
if ($config_function = _htmlpurifier_config_load($format)) {
......@@ -288,6 +288,7 @@ function _htmlpurifier_settings($delta, $format) {
'HTML.Allowed',
'HTML.ForbiddenElements',
'HTML.ForbiddenAttributes',
'AutoFormat.RemoveEmpty',
'AutoFormat.Linkify',
'AutoFormat.AutoParagraph',
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment