ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilHtmlPurifierFactory.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
9 {
16  public static function _getInstanceByType(string $type) : ilHtmlPurifierInterface
17  {
18  global $DIC;
19 
20  switch ($type) {
21  case 'frm_post':
22  return new ilHtmlForumPostPurifier();
23  break;
24 
25  case 'qpl_usersolution':
26  return new ilAssHtmlUserSolutionPurifier();
27  break;
28  }
29 
30  throw new ilHtmlPurifierNotFoundException(sprintf(
31  $DIC->language()->txt('frm_purifier_not_implemented_for_type_x'),
32  $type
33  ));
34  }
35 }
Concrete class for sanitizing html of forum posts.
$type
Factory for creating purifier instances.
Class for html related exception handling in ILIAS.
Interface for html sanitizing functionality.
global $DIC
Definition: goto.php:24
static _getInstanceByType(string $type)
Factory method for creating purifier instances.