ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilHtmlForumPostPurifier Class Reference

Concrete class for sanitizing html of forum posts. More...

+ Inheritance diagram for ilHtmlForumPostPurifier:
+ Collaboration diagram for ilHtmlForumPostPurifier:

Public Member Functions

 __construct ()
 ilHtmlForumPostPurifier constructor. More...
 
- Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 __construct ()
 ilHtmlPurifierAbstractLibWrapper constructor. More...
 
 purify (string $html)
 
 purifyArray (array $htmlCollection)
 

Protected Member Functions

 getPurifierConfigInstance ()
 Concrete function which builds a html purifier config instance. More...
 
- Protected Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 getPurifierConfigInstance ()
 
 setPurifier (HTMLPurifier $purifier)
 
 getPurifier ()
 
 removeUnsupportedElements (array $elements)
 Removes all unsupported elements. More...
 
 makeElementListTinyMceCompliant (array $elements)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
static _getCacheDirectory ()
 
- Protected Attributes inherited from ilHtmlPurifierAbstractLibWrapper
 $purifier
 

Detailed Description

Concrete class for sanitizing html of forum posts.

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

Definition at line 8 of file class.ilHtmlForumPostPurifier.php.

Constructor & Destructor Documentation

◆ __construct()

ilHtmlForumPostPurifier::__construct ( )

ilHtmlForumPostPurifier constructor.

Definition at line 13 of file class.ilHtmlForumPostPurifier.php.

References ILIAS\GlobalScreen\Provider\__construct().

14  {
16  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getPurifierConfigInstance()

ilHtmlForumPostPurifier::getPurifierConfigInstance ( )
protected

Concrete function which builds a html purifier config instance.

Returns
HTMLPurifier_Config Instance of HTMLPurifier_Config

Definition at line 22 of file class.ilHtmlForumPostPurifier.php.

References $config, ilHtmlPurifierAbstractLibWrapper\_getCacheDirectory(), ilObjAdvancedEditing\_getUsedHTMLTags(), ilHtmlPurifierAbstractLibWrapper\makeElementListTinyMceCompliant(), and ilHtmlPurifierAbstractLibWrapper\removeUnsupportedElements().

22  : HTMLPurifier_Config
23  {
24  $config = HTMLPurifier_Config::createDefault();
25  $config->set('HTML.DefinitionID', 'ilias forum post');
26  $config->set('HTML.DefinitionRev', 1);
27  $config->set('Cache.SerializerPath', ilHtmlPurifierAbstractLibWrapper::_getCacheDirectory());
28  $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
29 
30  $tags = ilObjAdvancedEditing::_getUsedHTMLTags('frm_post');
31  $tags = $this->makeElementListTinyMceCompliant($tags);
32  $config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
33  $config->set('HTML.ForbiddenAttributes', 'div@style');
34 
35  if ($def = $config->maybeGetRawHTMLDefinition()) {
36  $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
37  }
38 
39  return $config;
40  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
removeUnsupportedElements(array $elements)
Removes all unsupported elements.
+ Here is the call graph for this function:

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