ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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 ()
 Constructor.
- Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 purify ($a_html, $a_config=null)
 Filters an HTML snippet/document to be XSS-free and standards-compliant.
 purifyArray (Array $a_array_of_html, $a_config=null)
 Filters an array of HTML snippets/documents to be XSS-free and standards-compliant.
- Public Member Functions inherited from ilHtmlPurifierInterface
 purify ($a_html)
 Filters an HTML snippet/document to be XSS-free and standards-compliant.
 purifyArray (Array $a_array_of_html)
 Filters an array of HTML snippets/documents to be XSS-free and standards-compliant.

Static Public Attributes

static $_type = 'frm_post'

Protected Member Functions

 getPurifierConfigInstance ()
 Concrete function which builds a html purifier config instance.
- Protected Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 setPurifier (HTMLPurifier $oPurifier)
 Set the purifier by subclass.
 getPurifier ()
 Get the purifier.
 removeUnsupportedElements ($a_array)
 Removes all unsupported elements.

Additional Inherited Members

- Static Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
static _getCacheDirectory ()
 Get the directory for HTMLPurifier cache files.
- 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

ilHtmlForumPostPurifier::__construct ( )

Constructor.

public

Reimplemented from ilHtmlPurifierAbstractLibWrapper.

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

Member Function Documentation

ilHtmlForumPostPurifier::getPurifierConfigInstance ( )
protected

Concrete function which builds a html purifier config instance.

protected

Returns
HTMLPurifier_Config Instance of HTMLPurifier_Config

Reimplemented from ilHtmlPurifierAbstractLibWrapper.

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

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

{
include_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
$config->set('HTML.DefinitionID', 'ilias forum post');
$config->set('HTML.DefinitionRev', 1);
$config->set('HTML.Doctype', 'XHTML 1.0 Strict');
// Bugfix #5945: Necessary because TinyMCE does not use the "u"
// html element but <span style="text-decoration: underline">E</span>
if(in_array('u', $tags) && !in_array('span', $tags)) $tags[] = 'span';
$config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
$def = $config->getHTMLDefinition(true);
$def->addAttribute('a', 'target', new HTMLPurifier_AttrDef_Enum(
array('_blank', '_self', '_target', '_top')
));
return $config;
}

+ Here is the call graph for this function:

Field Documentation

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: