ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAccessibilityTrimmedDocumentPurifier.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
8 {
12  protected $inner;
13 
19  {
20  $this->inner = $inner;
21  }
22 
26  public function purify(string $html) : string
27  {
28  return trim($this->inner->purify($html));
29  }
30 
34  public function purifyArray(array $htmlCollection) : array
35  {
36  foreach ($htmlCollection as $key => $html) {
37  $htmlCollection[$key] = $this->purify($html);
38  }
39 
40  return $htmlCollection;
41  }
42 }
purifyArray(array $htmlCollection)
Filters an array of HTML snippets/documents to be XSS-free and standards-compliant.$htmlCollection string[]
__construct(ilHtmlPurifierInterface $inner)
ilAccessibilityTrimmedDocumentPurifier constructor.
Interface for html sanitizing functionality.
purify(string $html)
Filters an HTML snippet/document to be XSS-free and standards-compliant.string