ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier.kses.php File Reference

Emulation layer for code that used kses(), substituting in HTML Purifier. More...

Go to the source code of this file.

Functions

 kses ($string, $allowed_html, $allowed_protocols=null)

Detailed Description

Emulation layer for code that used kses(), substituting in HTML Purifier.

Definition in file HTMLPurifier.kses.php.

Function Documentation

kses (   $string,
  $allowed_html,
  $allowed_protocols = null 
)

Definition at line 10 of file HTMLPurifier.kses.php.

References HTMLPurifier_Config\createDefault(), and HTMLPurifier().

{
$allowed_elements = array();
$allowed_attributes = array();
foreach ($allowed_html as $element => $attributes) {
$allowed_elements[$element] = true;
foreach ($attributes as $attribute => $x) {
$allowed_attributes["$element.$attribute"] = true;
}
}
$config->set('HTML.AllowedElements', $allowed_elements);
$config->set('HTML.AllowedAttributes', $allowed_attributes);
$allowed_schemes = array();
if ($allowed_protocols !== null) {
$config->set('URI.AllowedSchemes', $allowed_protocols);
}
$purifier = new HTMLPurifier($config);
return $purifier->purify($string);
}

+ Here is the call graph for this function: