ILIAS  release_8 Revision v8.23
ilExcInstructionPurifier Class Reference
+ Inheritance diagram for ilExcInstructionPurifier:
+ Collaboration diagram for ilExcInstructionPurifier:

Public Member Functions

 __construct ()
 
- Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 __construct ()
 ilHtmlPurifierAbstractLibWrapper constructor. More...
 
 purify (string $html)
 Filters an HTML snippet/document to be XSS-free and standards-compliant. More...
 
 purifyArray (array $htmlCollection)
 Filters an array of HTML snippets/documents to be XSS-free and standards-compliant. More...
 

Protected Member Functions

 getPurifierConfigInstance ()
 
- Protected Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 getPurifierConfigInstance ()
 
 setPurifier (HTMLPurifier $purifier)
 
 getPurifier ()
 
 removeUnsupportedElements (array $elements)
 Removes all unsupported elements. More...
 
 makeElementListTinyMceCompliant (array $elements)
 

Protected Attributes

const TAGSET = ["strong", "em", "u", "ol", "li", "ul", "blockquote", "a", "p", "span", "br"]
 
- Protected Attributes inherited from ilHtmlPurifierAbstractLibWrapper
HTMLPurifier $purifier
 

Additional Inherited Members

- Static Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
static _getCacheDirectory ()
 

Detailed Description

Definition at line 21 of file class.ilExcInstructionPurifier.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcInstructionPurifier::__construct ( )

Definition at line 26 of file class.ilExcInstructionPurifier.php.

References ILIAS\GlobalScreen\Provider\__construct().

27  {
29  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getPurifierConfigInstance()

ilExcInstructionPurifier::getPurifierConfigInstance ( )
protected

Definition at line 31 of file class.ilExcInstructionPurifier.php.

References $config, ilHtmlPurifierAbstractLibWrapper\_getCacheDirectory(), ilHtmlPurifierAbstractLibWrapper\makeElementListTinyMceCompliant(), and ilHtmlPurifierAbstractLibWrapper\removeUnsupportedElements().

31  : HTMLPurifier_Config
32  {
33  $config = HTMLPurifier_Config::createDefault();
34  $config->set('HTML.DefinitionID', 'ilias exercise instruction');
35  $config->set('HTML.DefinitionRev', 1);
36  $config->set('Cache.SerializerPath', ilHtmlPurifierAbstractLibWrapper::_getCacheDirectory());
37  $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
38 
39  $tags = $this->makeElementListTinyMceCompliant(self::TAGSET);
40  $config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
41  $config->set('HTML.ForbiddenAttributes', 'div@style');
42 
43  if ($def = $config->maybeGetRawHTMLDefinition()) {
44  $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
45  }
46 
47  return $config;
48  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
removeUnsupportedElements(array $elements)
Removes all unsupported elements.
+ Here is the call graph for this function:

Field Documentation

◆ TAGSET

const ilExcInstructionPurifier::TAGSET = ["strong", "em", "u", "ol", "li", "ul", "blockquote", "a", "p", "span", "br"]
protected

Definition at line 24 of file class.ilExcInstructionPurifier.php.


The documentation for this class was generated from the following file: