Issue Bug Closed

#102507CKEditor do not remove Tags (Office-Tags like o:p) properly after updated to TYPO3 12.4.7

LUKA netconsult 11/24/23, 11:52 updated 07/09/24, 15:12

Description

The CKeditor does not properly remove the Tags defined in

EXT:rte_ckeditor/Configuration/RTE/Processing.yaml

processing:

## CONTENT TO DATABASE
HTMLparser_db:
  ## REMOVE OPEN OFFICE META DATA TAGS, WORD 2003 TAGS, LINK, META, STYLE AND TITLE TAGS, AND DEPRECATED HTML TAGS
  ## We use this rule instead of the denyTags rule so that we can protect custom tags without protecting these unwanted tags.
removeTags: [center, font, link, meta, o:p, sdfield, strike, style, title, u]
</code></pre>

I have testet it in a plain TYPO3 installation with only the bootstrap package added.

When i add this test source n the RTE

<p>
    <sdfield>sdfield</sdfield>
    <font>font</font>
</p>
<center>center</center>
<o:p>o:p</o:p>

and save it, i get this result:

<p>
    &lt;sdfield&gt;sdfield&lt;/sdfield&gt;&nbsp;<font>font</font>
</p>
<p>
    center
</p>
<p>
    &lt;o:p&gt;o:p&lt;/o:p&gt;
</p>

The

-Tag as removed as expected, the <o:p>-Tag and the <sdfield>-Tag is converted to htmlspecialchars and the <font>-Tag is not changed at all. <p>In TYPO3 version 12.4.6 it all works as expected.</p> We find out, that the in the file <pre>EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml<br></pre> the following part seems to cause this: <p>
    htmlSupport:
      allow:
        # Allow any class or any data attribute in any (configured) tag
        - { classes: true, attributes: { pattern: 'data-.+' } }
</p> <p>If i remove this, the Tags are all removed properly. But then no classes in no Tags are allowed and so no Style is persistent.</p> <p>If i change this line and add a tag-name it also works as expected but classes then are only allowed for this tag only.</p> <p>
    htmlSupport:
      allow:
        # Allow any class or any data attribute in any (configured) tag
        - { name: 'div', classes: true, attributes: { pattern: 'data-.+' } }
</p></font></sdfield></o:p>

Reviews 2