ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilHtmlPurifierFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
27  public static function getInstanceByType(string $type): ilHtmlPurifierInterface
28  {
29  global $DIC;
30 
31  return match ($type) {
32  'frm_post' => new ilHtmlForumPostPurifier(),
33  'qpl_usersolution' => new ilAssHtmlUserSolutionPurifier(),
34  default => throw new ilHtmlPurifierNotFoundException(sprintf(
35  $DIC->language()->txt('frm_purifier_not_implemented_for_type_x'),
36  $type
37  )),
38  };
39  }
40 }
Concrete class for sanitizing html of forum posts.
Factory for creating purifier instances.
Class ilHtmlPurifierNotFoundException.
Interface for html sanitizing functionality.
global $DIC
Definition: shib_login.php:22
static getInstanceByType(string $type)