You are here

function _htmlpurifier_get_config in HTML Purifier 5

Same name and namespace in other branches
  1. 6.2 htmlpurifier.module \_htmlpurifier_get_config()
  2. 6 htmlpurifier.module \_htmlpurifier_get_config()
  3. 7.2 htmlpurifier.module \_htmlpurifier_get_config()
  4. 7 htmlpurifier.module \_htmlpurifier_get_config()
1 call to _htmlpurifier_get_config()
htmlpurifier_filter in ./htmlpurifier.module
Implementation of hook_filter().

File

./htmlpurifier.module, line 176

Code

function _htmlpurifier_get_config($format) {
  $config = array(
    'Core.AggressivelyFixLt' => TRUE,
    'Cache.DefinitionImpl' => 'Drupal',
    'URI.DisableExternalResources' => variable_get("htmlpurifier_externalresources_{$format}", TRUE),
    'Attr.EnableID' => variable_get("htmlpurifier_enableattrid_{$format}", FALSE),
    'AutoFormat.Linkify' => variable_get("htmlpurifier_linkify_{$format}", TRUE),
    'AutoFormat.AutoParagraph' => variable_get("htmlpurifier_autoparagraph_{$format}", TRUE),
    'HTML.SafeEmbed' => variable_get('htmlpurifier_allow_embed', FALSE),
    'HTML.SafeObject' => variable_get('htmlpurifier_allow_embed', FALSE),
    'HTML.Allowed' => variable_get("htmlpurifier_allowedhtml_enabled_{$format}", FALSE) ? variable_get("htmlpurifier_allowedhtml_{$format}", '') : null,
  );
  if (defined('HTMLPurifier::VERSION') && version_compare(constant('HTMLPurifier::VERSION'), '3.1.0-dev', '>=')) {
    $config['HTML.ForbiddenElements'] = variable_get("htmlpurifier_forbiddenelements_{$format}", '');
    $config['HTML.ForbiddenAttributes'] = variable_get("htmlpurifier_forbiddenattributes_{$format}", '');
  }
  return $config;
}