ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilAssHtmlPurifier Class Reference
+ Inheritance diagram for ilAssHtmlPurifier:
+ Collaboration diagram for ilAssHtmlPurifier:

Protected Member Functions

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

Private Member Functions

 getAllowedElements ()
 
 getElementsUsedForAdvancedEditing ()
 

Additional Inherited Members

- Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 __construct ()
 ilHtmlPurifierAbstractLibWrapper constructor. More...
 
 purify (string $html)
 @inheritDoc More...
 
 purifyArray (array $htmlCollection)
 @inheritDoc 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...
 
- Static Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
static _getCacheDirectory ()
 
- Protected Attributes inherited from ilHtmlPurifierAbstractLibWrapper
 $purifier
 

Detailed Description

Definition at line 12 of file class.ilAssHtmlPurifier.php.

Member Function Documentation

◆ getAllowedElements()

ilAssHtmlPurifier::getAllowedElements ( )
private

Definition at line 47 of file class.ilAssHtmlPurifier.php.

48 {
49 $allowedElements = $this->getElementsUsedForAdvancedEditing();
50
51 $allowedElements = $this->makeElementListTinyMceCompliant($allowedElements);
52 $allowedElements = $this->removeUnsupportedElements($allowedElements);
53
54 return $allowedElements;
55 }
removeUnsupportedElements(array $elements)
Removes all unsupported elements.

References getElementsUsedForAdvancedEditing(), ilHtmlPurifierAbstractLibWrapper\makeElementListTinyMceCompliant(), and ilHtmlPurifierAbstractLibWrapper\removeUnsupportedElements().

Referenced by getPurifierConfigInstance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getElementsUsedForAdvancedEditing()

ilAssHtmlPurifier::getElementsUsedForAdvancedEditing ( )
private

Definition at line 57 of file class.ilAssHtmlPurifier.php.

58 {
59 include_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
61 }
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.

References ilObjAdvancedEditing\_getUsedHTMLTags(), and getPurifierType().

Referenced by getAllowedElements().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPurifierConfigInstance()

ilAssHtmlPurifier::getPurifierConfigInstance ( )
protected
Returns
HTMLPurifier_Config Instance of HTMLPurifier_Config

Reimplemented from ilHtmlPurifierAbstractLibWrapper.

Definition at line 22 of file class.ilAssHtmlPurifier.php.

22 : HTMLPurifier_Config
23 {
24 $config = HTMLPurifier_Config::createDefault();
25 $config->set('HTML.DefinitionID', $this->getPurifierType());
26 $config->set('HTML.DefinitionRev', 1);
28 $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
29 $config->set('HTML.AllowedElements', $this->getAllowedElements());
30 $config->set('HTML.ForbiddenAttributes', 'div@style');
31 $config->autoFinalize = false;
32 $config->set(
33 'URI.AllowedSchemes',
34 array_merge(
35 $config->get('URI.AllowedSchemes'),
36 ['data' => true]
37 )
38 );
39 $config->autoFinalize = true;
40 if ($def = $config->maybeGetRawHTMLDefinition()) {
41 $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
42 }
43
44 return $config;
45 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

References $config, ilHtmlPurifierAbstractLibWrapper\_getCacheDirectory(), getAllowedElements(), and getPurifierType().

+ Here is the call graph for this function:

◆ getPurifierType()

ilAssHtmlPurifier::getPurifierType ( )
protected

Definition at line 14 of file class.ilAssHtmlPurifier.php.

15 {
16 return 'assessment';
17 }

Referenced by getElementsUsedForAdvancedEditing(), and getPurifierConfigInstance().

+ Here is the caller graph for this function:

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