Review main Merged

86047[BUGFIX] Apply `removeTags` in RTE YAML default processing

Garvin Hicking CR +2 V +2 Hard +274 −56 updated 10/02/24, 13:03

Commit message

The RTE YAML configuration `Processing.yaml` defined `removeTags`
as an array, while the HTMLParser only evaluated strings as input.

Due to this, `removeTags` in the TYPO3 default YAML config
were never applied, and thus tags were NOT removed before getting
persisted into the database. They were however escaped in the
frontend output, apart from the tags:

- `center`
- `font`
- `img`
- `strike`
- `u`

Only Page TSconfig processing configuration was properly
applied before.

With this bugfix, the following things change:

- A functional test is introduced to verify the behavior.

- The 'security' related test has been adapted, because
  now title tags are already stripped. Test has also
  been enhanced to address the `removeTags` influence.

- The tags `u` and `strike` are no longer removed, because
  they were set as allowTags earlier on, and that
  should take precedence.

- The tags `center` and `font` remain to be allowed now,
  to not introduce a breaking change.

- A note has been added that in TYPO3 v14 the original
  intent to remove `center`, `font` and probably
  `strike` are to be added to `removeTags` and thus
  removed in the future from database persistence.

- The YAML directive is now configured to both
  parse a string list or an array. This will
  allow existing YAML configurations to properly
  take effect without manual fixing.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Guido Schmechel +1
    • Simon Praetorius +1
    • Oliver Hader +1
    • Benni Mack +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Oliver Hader +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 5

Review log 2228

Show 23 earlier messages
  1. Garvin Hicking uploaded patch set 1 09/12/24, 13:09

  2. Garvin Hicking commented on patch set 1 09/12/24, 13:12

    BACKPORT NOTE: I think we should not backport this to 11.5 because for older versions this may do more bad then good in terms of "expected results". I do believe we should fix this in the currently stable version. I am not sure where to put the Important changelog so that both v13 and v12 users will properly take notice. Should it be put into the 12.4 AND the 13.3 directories? If it's only in 'v13', v12 users may not recognize it. If it's only in 'v12', the v13 users may not notice. This is a change that IMO needs explicit mentioning in the release notes.
  3. core-ci voted on patch set 1 V -1 09/12/24, 13:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65563

  1. Garvin Hicking uploaded patch set 2 V -1 09/12/24, 13:33

    Fix security test
  2. Andreas Kienast commented on patch set 2 09/12/24, 13:37

    Please prepend your commit message with `[!!!]` and rename the ReST from "Important" to "Breaking".
  3. core-ci voted on patch set 2 V +1 09/12/24, 13:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65566

  4. Garvin Hicking uploaded patch set 3 V +1 09/12/24, 13:50

    Adjust to breaking
  5. Garvin Hicking commented on patch set 3 09/12/24, 13:51

    Reply

    Done
  6. Andreas Kienast commented on patch set 3 09/12/24, 13:53

    Breaking-104839-RTEProcessingConfigurationRespectsRemoveTags.rst:3

    breaking
  7. core-ci voted on patch set 3 V -1 09/12/24, 13:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65573

  8. Garvin Hicking uploaded patch set 4 V -1 09/12/24, 14:00

    adjust rest
  9. Garvin Hicking commented on patch set 4 09/12/24, 14:00

    Breaking-104839-RTEProcessingConfigurationRespectsRemoveTags.rst:3 Reply

    sigh. thx.
  10. core-ci voted on patch set 4 V +1 09/12/24, 14:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65574

  11. Benni Mack commented on patch set 4 09/12/24, 15:06

    IMHO this is a valid bugfix. However, I've seen people going nuts with the CKEditor5 font plugin ("TYPO3 Christmas Tree Edition"). I suggest to actually make the default of "removeTags" empty in v13 and enable them (breaking) in v14.
  12. Garvin Hicking commented on patch set 4 09/12/24, 15:46

    Reply

    In that case I would: - remove font (and center?) in this patch, so it's kept - but keep the other tags that really should be cleared (theoretically breaking, but IMO no real-life impact (style, title, o:p,...) - so we'd keep the "breaking" intact just in cass, also to alert people that this never worked - announce that v14 will als add font (and center) with "real-life" impact chance Then create a seperate follow-up for v14 and add "font" (and center) back again, the with the "real" breakage. wdyt?
  13. Oliver Hader commented on patch set 4 09/12/24, 17:16

    Reply

    Sound good to me... thus, from my POV the remaining setting would be ``` removeTags: [link, meta, o:p, sdfield, style, title] ``` All of those tag names are not allowed in blocks, or are not part of the specs (I guess `sdfield` refers to LibreOffice?). Thus, I think this change would be just "important" instead of "breaking", correct?
  14. Garvin Hicking uploaded patch set 5 V +1 09/12/24, 21:29

    Change to Important instead Breaking
  15. Garvin Hicking commented on patch set 5 09/12/24, 21:31

    Reply

    I've relabelled this patch as "Important" again and adjusted the tests, commit message and ReST file. How would we store the ReST file? Putting it into "13.3" would make backporting odd. Putting it into "12.4" might not alert people who only read the 13.3 changelogs. What's the usual procedure then? Add a stub in "13.3" that just points to the entry in "12.4"?
  16. core-ci voted on patch set 5 V +1 09/12/24, 21:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65608

  17. Garvin Hicking uploaded patch set 6 V +1 09/18/24, 11:54

    Move ReST
  18. Garvin Hicking commented on patch set 6 09/18/24, 11:55

    Reply

    Moving CL to 12.4.x directory. Adapted to add a v11 note.

    Reply

    Done
    Moved the ReST to 12.4.x, adapted wording a bit and dropped a v11 note.
  19. core-ci voted on patch set 6 V +1 09/18/24, 12:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66129

  20. Benni Mack voted on patch set 6 CR +1 V +1 09/19/24, 10:08

  21. Guido Schmechel voted on patch set 6 CR +1 10/01/24, 16:22

  22. Simon Praetorius voted on patch set 6 CR +1 10/01/24, 16:23

  23. Oliver Hader voted on patch set 6 CR +1 V +1 10/02/24, 11:46

  24. Garvin Hicking voted on patch set 6 CR +2 V +2 10/02/24, 13:02

  25. Garvin Hicking merged patch set 7 10/02/24, 13:03