ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilTermsOfServiceTrimmedDocumentPurifier.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
28 
29  public function __construct(ilHtmlPurifierInterface $inner)
30  {
31  $this->inner = $inner;
32  }
33 
34  public function purify(string $html): string
35  {
36  return trim($this->inner->purify($html));
37  }
38 
39  public function purifyArray(array $htmlCollection): array
40  {
41  foreach ($htmlCollection as $key => $html) {
42  $htmlCollection[$key] = $this->purify($html);
43  }
44 
45  return $htmlCollection;
46  }
47 }
purify(string $html)
Filters an HTML snippet/document to be XSS-free and standards-compliant.
Interface for html sanitizing functionality.
string $key
Consumer key/client ID value.
Definition: System.php:193
purifyArray(array $htmlCollection)
Filters an array of HTML snippets/documents to be XSS-free and standards-compliant.