joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.7k stars 3.63k forks source link

[4.1] Editor custom field 'Safe HTML' setting not working correctly with iframes #37726

Open Scrabble96 opened 2 years ago

Scrabble96 commented 2 years ago

Steps to reproduce the issue

Switch back to the WYSIWYG editor Save the document

Expected result

The map is saved and visible

Actual result

TinyMCE: Switching from Code to Editor shows just a blank box, then even before saving the article the code is reduced to <p><iframe></iframe></p>

JCE Editor: The map is visible in the Editor pane prior to saving the article, after which the code is stripped out entirely

System information (as much as possible)

J4.1.2

Additional comments

It does the same with the 'RAW html' setting

brianteeman commented 2 years ago

This is the intended and expected behaviour

Look at the tinymce plugin and you will see that by default it prevents iframes

image

Either change the behaviour here in the tinymce editor plugin OR what I do is to change tinymce to use the Joomla Text Filters in the global config so I am only managing them in one place.

Scrabble96 commented 2 years ago

In my original post, you will see that I said "If using TinyMCE, ensure 'iframe' is removed from the list of prohibited elements in the plugin settings" which is what I did.

Switching to Joomla text filters makes no difference as super users have no filtering applied.

Scrabble96 commented 2 years ago

I have since discovered that TinyMCE (but not JCE) is stripping all tags except for the first and last, e.g: <p>This is some text</p> <p>This is some more text</p> becomes: <p>This is some textThis is some more text</p>

Scrabble96 commented 2 years ago

UPDATE: this is very odd, as switching to Joomla text filters is now working as it should, but it still doesn't explain why it doesn't work the other way. New users to J4 wouldn't have a clue as there are no hints to what "Use Joomla Text Filter" means.

Quy commented 2 years ago

Maybe related #31540?