Skip to content

Commit 70d8698

Browse files
[FEATURE] Forum: Allow data schema for "TinyMCE" images
See: https://mantis.ilias.de/view.php?id=47421 (cherry picked from commit 8a76c94)
1 parent 087aadd commit 70d8698

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

components/ILIAS/Forum/classes/Purifier/class.ilHtmlForumPostPurifier.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function getPurifierConfigInstance(): HTMLPurifier_Config
2828
{
2929
$config = HTMLPurifier_Config::createDefault();
3030
$config->set('HTML.DefinitionID', 'ilias forum post');
31-
$config->set('HTML.DefinitionRev', 2);
31+
$config->set('HTML.DefinitionRev', 3);
3232
$config->set('Cache.SerializerPath', ilHtmlPurifierAbstractLibWrapper::_getCacheDirectory());
3333
$config->set('HTML.Doctype', 'XHTML 1.0 Strict');
3434

@@ -37,6 +37,16 @@ protected function getPurifierConfigInstance(): HTMLPurifier_Config
3737
$config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
3838
$config->set('HTML.ForbiddenAttributes', 'div@style');
3939

40+
$config->autoFinalize = false;
41+
$config->set(
42+
'URI.AllowedSchemes',
43+
array_merge(
44+
$config->get('URI.AllowedSchemes'),
45+
['data' => true]
46+
)
47+
);
48+
$config->autoFinalize = true;
49+
4050
if (($def = $config->maybeGetRawHTMLDefinition()) !== null) {
4151
$def->addAttribute('img', 'data-id', 'Number');
4252
$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');

0 commit comments

Comments
 (0)