ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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()

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

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

11{
13 $allowed_elements = array();
14 $allowed_attributes = array();
15 foreach ($allowed_html as $element => $attributes) {
16 $allowed_elements[$element] = true;
17 foreach ($attributes as $attribute => $x) {
18 $allowed_attributes["$element.$attribute"] = true;
19 }
20 }
21 $config->set('HTML.AllowedElements', $allowed_elements);
22 $config->set('HTML.AllowedAttributes', $allowed_attributes);
23 if ($allowed_protocols !== null) {
24 $config->set('URI.AllowedSchemes', $allowed_protocols);
25 }
26 $purifier = new HTMLPurifier($config);
27 return $purifier->purify($string);
28}
HTMLPurifier($html, $config=null)
Purify HTML.
static createDefault()
Convenience constructor that creates a default configuration object.
Definition: Config.php:154
$x
Definition: example_009.php:98

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

+ Here is the call graph for this function: