Review 10.4 Merged

71926[BUGFIX] Do not HTML encode attributes in Script and Asset VH

Benni Mack CR +2 V +2 Normal +227 −1 updated 11/05/21, 11:54

Commit message

ScriptViewHelper and AssetViewHelper do not directly output any tag,
but only pass the arguments to AssetCollector.

Therefore the tag attribute values must not be HTML encoded.
To achieve that, we use a subclass of TagBuilder before the tag
is initialised, which does never encode attribute values.

The tag view helper inheritance is kept because the tag builder
nicely abstracts attribute handling, which otherwise would have to
be duplicated.

Also ensure that rendered children will not be encoded as this string
is used as CSS or JavaScript, where HTML encoding won't help or rather
break the code.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 2

Files 4

Review log 69

  1. Benni Mack commented on patch set 1 11/05/21, 11:32

    Cherry Picked from branch master. The following files contain Git conflicts: * typo3/sysext/fluid/Tests/Functional/ViewHelpers/Asset/ScriptViewHelperTest.php
  2. Benni Mack commented on patch set 2 11/05/21, 11:32

    Published edit on patch set 1.
  3. Benni Mack marked it ready for review 11/05/21, 11:32

  4. core-ci voted on patch set 1 V -1 11/05/21, 11:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18942

  5. core-ci voted on patch set 2 V -1 11/05/21, 11:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18943

  6. Benni Mack uploaded patch set 3 11/05/21, 11:40

  7. core-ci voted on patch set 3 V +1 11/05/21, 11:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18946

  8. Benni Mack voted on patch set 3 V +2 CR +2 11/05/21, 11:54

  9. Benni Mack merged patch set 4 11/05/21, 11:54