ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilHtmlForumPostPurifier Class Reference

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

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

Public Member Functions

 __construct ()
 Constructor. More...
 
- Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 __construct ()
 Constructor. More...
 
 purify ($a_html, $a_config=null)
 Filters an HTML snippet/document to be XSS-free and standards-compliant. More...
 
 purifyArray (array $a_array_of_html, $a_config=null)
 Filters an array of HTML snippets/documents to be XSS-free and standards-compliant. More...
 
- Public Member Functions inherited from ilHtmlPurifierInterface
 purify ($a_html)
 Filters an HTML snippet/document to be XSS-free and standards-compliant. More...
 
 purifyArray (array $a_array_of_html)
 Filters an array of HTML snippets/documents to be XSS-free and standards-compliant. More...
 

Static Public Attributes

static $_type = 'frm_post'
 

Protected Member Functions

 getPurifierConfigInstance ()
 Concrete function which builds a html purifier config instance. More...
 
- Protected Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 getPurifierConfigInstance ()
 Has to be implemented by subclasses to build the HTMLPurifier_Config instance with object specific configurations. More...
 
 setPurifier (HTMLPurifier $oPurifier)
 Set the purifier by subclass. More...
 
 getPurifier ()
 Get the purifier. More...
 
 removeUnsupportedElements ($a_array)
 Removes all unsupported elements. More...
 
 makeElementListTinyMceCompliant ($elements)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
static _getCacheDirectory ()
 Get the directory for HTMLPurifier cache files. More...
 
- Protected Attributes inherited from ilHtmlPurifierAbstractLibWrapper
 $oPurifier = null
 

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
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilHtmlForumPostPurifier::__construct ( )

Constructor.

public

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

33  {
34  parent::__construct();
35  }

Member Function Documentation

◆ getPurifierConfigInstance()

ilHtmlForumPostPurifier::getPurifierConfigInstance ( )
protected

Concrete function which builds a html purifier config instance.

protected

Returns
HTMLPurifier_Config Instance of HTMLPurifier_Config

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

References $config, $def, $tags, ilHtmlPurifierAbstractLibWrapper\_getCacheDirectory(), ilObjAdvancedEditing\_getUsedHTMLTags(), HTMLPurifier_Config\createDefault(), ilHtmlPurifierAbstractLibWrapper\makeElementListTinyMceCompliant(), and ilHtmlPurifierAbstractLibWrapper\removeUnsupportedElements().

45  {
46  include_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
47 
49  $config->set('HTML.DefinitionID', 'ilias forum post');
50  $config->set('HTML.DefinitionRev', 1);
51  $config->set('Cache.SerializerPath', ilHtmlPurifierAbstractLibWrapper::_getCacheDirectory());
52  $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
53 
56  $config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
57  $config->set('HTML.ForbiddenAttributes', 'div@style');
58 
59  if ($def = $config->maybeGetRawHTMLDefinition()) {
60  $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
61  }
62 
63  return $config;
64  }
$config
Definition: bootstrap.php:15
static _getCacheDirectory()
Get the directory for HTMLPurifier cache files.
removeUnsupportedElements($a_array)
Removes all unsupported elements.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
$tags
Definition: croninfo.php:19
static createDefault()
Convenience constructor that creates a default configuration object.
Definition: Config.php:154
$def
Definition: croninfo.php:21
+ Here is the call graph for this function:

Field Documentation

◆ $_type

ilHtmlForumPostPurifier::$_type = 'frm_post'
static

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


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