ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilWebDAVMountInstructionsDocumentPurifier Class Reference
+ Inheritance diagram for ilWebDAVMountInstructionsDocumentPurifier:
+ Collaboration diagram for ilWebDAVMountInstructionsDocumentPurifier:

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

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ getPurifierConfigInstance()

ilWebDAVMountInstructionsDocumentPurifier::getPurifierConfigInstance ( )
protected

Reimplemented from ilHtmlPurifierAbstractLibWrapper.

Definition at line 34 of file class.ilWebDAVMountInstructionsDocumentPurifier.php.

34 : HTMLPurifier_Config
35 {
36 $config = HTMLPurifier_Config::createDefault();
37 $config->set('HTML.DefinitionID', 'ilias termsofservice document');
38 $config->set('HTML.DefinitionRev', 1);
39 $config->set('HTML.TargetBlank', true);
40 $config->set('Cache.SerializerPath', $this->cacheDirectory);
41 $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
42
43 $tags = $this->allowedTags;
44 $tags = $this->makeElementListTinyMceCompliant($tags);
45
46 $tags[] = 'b';
47 $tags[] = 'i';
48
49 $config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
50 $config->set('HTML.ForbiddenAttributes', 'div@style');
51
52 if ($def = $config->maybeGetRawHTMLDefinition()) {
53 $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
54 }
55
56 return $config;
57 }
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 ilWebDAVMountInstructionsDocumentPurifier::$allowedTags
private

◆ $cacheDirectory

string ilWebDAVMountInstructionsDocumentPurifier::$cacheDirectory
protected

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

Referenced by __construct().


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