ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilHtmlPurifierFactory.php
Go to the documentation of this file.
1<?php
2
19declare(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.
static getInstanceByType(string $type)
Class ilHtmlPurifierNotFoundException.
Interface for html sanitizing functionality.
global $DIC
Definition: shib_login.php:26