ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilTermsOfServiceTrimmedDocumentPurifier.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
13 protected $inner;
14
20 {
21 $this->inner = $inner;
22 }
23
27 public function purify(string $html) : string
28 {
29 return trim($this->inner->purify($html));
30 }
31
35 public function purifyArray(array $htmlCollection) : array
36 {
37 foreach ($htmlCollection as $key => $html) {
38 $htmlCollection[$key] = $this->purify($html);
39 }
40
41 return $htmlCollection;
42 }
43}
An exception for terminatinating execution or to throw for unit testing.
__construct(ilHtmlPurifierInterface $inner)
ilTermsOfServiceTrimmedDocumentPurifier constructor.
purifyArray(array $htmlCollection)
Filters an array of HTML snippets/documents to be XSS-free and standards-compliant....
purify(string $html)
Filters an HTML snippet/document to be XSS-free and standards-compliant.string
Interface for html sanitizing functionality.