ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWebDAVMountInstructionsDocumentPurifier 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 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...
 

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ getPurifierConfigInstance()

ilWebDAVMountInstructionsDocumentPurifier::getPurifierConfigInstance ( )
protected

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

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

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

◆ $allowedTags

array ilWebDAVMountInstructionsDocumentPurifier::$allowedTags
private

◆ $cacheDirectory

string ilWebDAVMountInstructionsDocumentPurifier::$cacheDirectory
protected

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