ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilHtmlPurifierFactory Class Reference

Factory for creating purifier instances. More...

+ Collaboration diagram for ilHtmlPurifierFactory:

Static Public Member Functions

static getInstanceByType (string $type)
 

Detailed Description

Factory for creating purifier instances.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 25 of file class.ilHtmlPurifierFactory.php.

Member Function Documentation

◆ getInstanceByType()

static ilHtmlPurifierFactory::getInstanceByType ( string  $type)
static

Definition at line 27 of file class.ilHtmlPurifierFactory.php.

References $DIC.

Referenced by ilForumThreadFormGUI\addMessageInput(), assQuestion\getHtmlQuestionContentPurifier(), ilObjTest\getHtmlQuestionContentPurifier(), assQuestion\getHtmlUserSolutionPurifier(), ilForumXMLParser\handlerEndTag(), and ilObjForumGUI\initReplyEditForm().

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  }
Concrete class for sanitizing html of forum posts.
Class ilHtmlPurifierNotFoundException.
Interface for html sanitizing functionality.
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: