ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAccessibilityDocumentHtmlPurifier Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilAccessibilityDocumentHtmlPurifier:
+ Collaboration diagram for ilAccessibilityDocumentHtmlPurifier:

Public Member Functions

 __construct (?array $allowedTags=null, ?string $cacheDirectory=null)
 
- 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...
 
 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

string $cacheDirectory = ''
 
- Protected Attributes inherited from ilHtmlPurifierAbstractLibWrapper
HTMLPurifier $purifier
 

Private Attributes

array $allowedTags = []
 

Additional Inherited Members

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

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilAccessibilityDocumentHtmlPurifier

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

Constructor & Destructor Documentation

◆ __construct()

ilAccessibilityDocumentHtmlPurifier::__construct ( ?array  $allowedTags = null,
?string  $cacheDirectory = null 
)

Member Function Documentation

◆ getPurifierConfigInstance()

ilAccessibilityDocumentHtmlPurifier::getPurifierConfigInstance ( )
protected

Reimplemented from ilHtmlPurifierAbstractLibWrapper.

Definition at line 43 of file class.ilAccessibilityDocumentHtmlPurifier.php.

43 : HTMLPurifier_Config
44 {
45 $config = HTMLPurifier_Config::createDefault();
46 $config->set('HTML.DefinitionID', 'ilias accessibility document');
47 $config->set('HTML.DefinitionRev', 1);
48 $config->set('HTML.TargetBlank', true);
49 $config->set('Cache.SerializerPath', $this->cacheDirectory);
50 $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
51
52 $tags = $this->allowedTags;
53 $tags = $this->makeElementListTinyMceCompliant($tags);
54
55 $tags[] = 'b';
56 $tags[] = 'i';
57
58 $config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
59 $config->set('HTML.ForbiddenAttributes', 'div@style');
60
61 if ($def = $config->maybeGetRawHTMLDefinition()) {
62 $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
63 }
64
65 return $config;
66 }
removeUnsupportedElements(array $elements)
Removes all unsupported elements.

References $allowedTags, ilHtmlPurifierAbstractLibWrapper\makeElementListTinyMceCompliant(), and ilHtmlPurifierAbstractLibWrapper\removeUnsupportedElements().

+ Here is the call graph for this function:

Field Documentation

◆ $allowedTags

array ilAccessibilityDocumentHtmlPurifier::$allowedTags = []
private

◆ $cacheDirectory

string ilAccessibilityDocumentHtmlPurifier::$cacheDirectory = ''
protected

Definition at line 25 of file class.ilAccessibilityDocumentHtmlPurifier.php.

Referenced by __construct().


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