ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilHtmlForumPostPurifier.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
require_once
'Services/Html/classes/class.ilHtmlPurifierAbstractLibWrapper.php'
;
5
13
class
ilHtmlForumPostPurifier
extends
ilHtmlPurifierAbstractLibWrapper
14
{
24
public
static
$_type
=
'frm_post'
;
25
32
public
function
__construct
()
33
{
34
parent::__construct();
35
}
36
44
protected
function
getPurifierConfigInstance
()
45
{
46
include_once
'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php'
;
47
48
$config
=
HTMLPurifier_Config::createDefault
();
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
54
$tags
=
ilObjAdvancedEditing::_getUsedHTMLTags
(self::$_type);
55
$tags
= $this->
makeElementListTinyMceCompliant
(
$tags
);
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
}
65
}
ilHtmlForumPostPurifier
Concrete class for sanitizing html of forum posts.
Definition:
class.ilHtmlForumPostPurifier.php:13
$config
$config
Definition:
flush-definition-cache.php:23
ilHtmlPurifierAbstractLibWrapper\_getCacheDirectory
static _getCacheDirectory()
Get the directory for HTMLPurifier cache files.
Definition:
class.ilHtmlPurifierAbstractLibWrapper.php:117
ilHtmlPurifierAbstractLibWrapper\removeUnsupportedElements
removeUnsupportedElements($a_array)
Removes all unsupported elements.
Definition:
class.ilHtmlPurifierAbstractLibWrapper.php:136
ilObjAdvancedEditing\_getUsedHTMLTags
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
Definition:
class.ilObjAdvancedEditing.php:99
ilHtmlForumPostPurifier\getPurifierConfigInstance
getPurifierConfigInstance()
Concrete function which builds a html purifier config instance.
Definition:
class.ilHtmlForumPostPurifier.php:44
ilHtmlPurifierAbstractLibWrapper
Abstract class wrapping the HTMLPurifier instance.
Definition:
class.ilHtmlPurifierAbstractLibWrapper.php:15
ilHtmlForumPostPurifier\$_type
static $_type
Definition:
class.ilHtmlForumPostPurifier.php:24
$tags
$tags
Definition:
croninfo.php:19
ilHtmlForumPostPurifier\__construct
__construct()
Constructor.
Definition:
class.ilHtmlForumPostPurifier.php:32
HTMLPurifier_Config\createDefault
static createDefault()
Convenience constructor that creates a default configuration object.
Definition:
Config.php:154
$def
$def
Definition:
croninfo.php:21
ilHtmlPurifierAbstractLibWrapper\makeElementListTinyMceCompliant
makeElementListTinyMceCompliant($elements)
Definition:
class.ilHtmlPurifierAbstractLibWrapper.php:162
Services
Html
classes
class.ilHtmlForumPostPurifier.php
Generated on Tue Jan 14 2025 19:01:30 for ILIAS by
1.8.13 (using
Doxyfile
)