19 declare(strict_types=1);
39 final public function purify(
string $html): string
41 return $this->purifier->purify($html);
44 final public function purifyArray(array $htmlCollection): array
46 foreach ($htmlCollection as
$key => $html) {
47 if (!is_string($html)) {
49 'The element on index %s is not of type string: %s',
56 return $this->purifier->purifyArray($htmlCollection);
61 final protected function setPurifier(HTMLPurifier $purifier): self
88 $supportedElements = [];
103 foreach ($elements as $element) {
104 if (!in_array($element, $notSupportedTags)) {
105 $supportedElements[] = $element;
109 return $supportedElements;
121 if (in_array(
'u', $elements) && !in_array(
'span', $elements)) {
122 $elements[] =
'span';
static _getCacheDirectory()
makeElementListTinyMceCompliant(array $elements)
purifyArray(array $htmlCollection)
Filters an array of HTML snippets/documents to be XSS-free and standards-compliant.
removeUnsupportedElements(array $elements)
Removes all unsupported elements.
getPurifierConfigInstance()
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
Abstract class wrapping the HTMLPurifier instance.
purify(string $html)
Filters an HTML snippet/document to be XSS-free and standards-compliant.
__construct()
ilHtmlPurifierAbstractLibWrapper constructor.
Interface for html sanitizing functionality.
static getDataDir()
get data directory (outside webspace)
setPurifier(HTMLPurifier $purifier)