Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow TinyMCE to convert safe embed/objects to audio/img/video #16834

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"select2": "^4.0.13",
"spectrum-colorpicker2": "^2.0.9",
"spin.js": "^4.1.0",
"tinymce": "^6.7.3",
"tinymce": "^6.8.3",
"tinymce-i18n": "^23.6.19"
},
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions src/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -3851,7 +3851,7 @@ public static function initEditorSystem($id, $rand = '', $display = true, $reado
$cache_suffix = '?v=' . FrontEnd::getVersionCacheKey(GLPI_VERSION);
$readonlyjs = $readonly ? 'true' : 'false';

$invalid_elements = 'applet,canvas,embed,form,object';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove embed and object? That honestly seems tags that should not be used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With convert_unsafe_embeds=true, they will be converted to audio, img or video tags. The purpose is to correctly handle pasting a content from an HTML page that uses object or embed for a media content.

Anyway, this is not mandatory, and cannot be done before tinymce/tinymce#9516 is fixed on TinyMCE side.

$invalid_elements = 'applet,canvas,form';
if (!$enable_images) {
$invalid_elements .= ',img';
}
Expand Down Expand Up @@ -3934,11 +3934,14 @@ public static function initEditorSystem($id, $rand = '', $display = true, $reado

// Content settings
entity_encoding: 'raw',
invalid_elements: '{$invalid_elements}',
readonly: {$readonlyjs},
relative_urls: false,
remove_script_host: false,

// Security settings
convert_unsafe_embeds: true,
invalid_elements: '{$invalid_elements}',

// Misc options
browser_spellcheck: true,
cache_suffix: '{$cache_suffix}',
Expand Down