Issue Bug Closed

#95158HtmlSanitizer accidentally enforced again due to sys_note changes

Oliver Hader 09/08/21, 17:16 updated 10/20/21, 11:03

Description

Issue #67556 introduced default configuration to be able to render links (anchor tags) in sys_note representation in backend context. Side-note: Usually the backend context does not have any frontend TypoScript config in lib.parseFunc_RTE, that’s why links defined in RTE were not substituted.

As a negative side-effect <f:format.html parseFuncTSPath="">{content}</f:format.html> now (again) enforces HtmlSanitizer, which is to the expected behavior.

Possible solution:
  • revert change https://review.typo3.org/c/Packages/TYPO3.CMS/+/70740 (was for v11.4.0 only)
  • introduce new feature(sic!) <f:transform.link> (or f:format.link, I don’t care about the name here)
    • which transforms <a href="t3://whatever"> into proper <a href="https://my-site.com/url"> tags
    • which is independent from any frontend and TypoScript context
    • which can be used in backend as well
  • substitute corresponding backend templates to apply HTML sanitization and link transformation, WITHOUT invoking ContentObjectRenderer::parseFunc

(in backend, e.g. the apply following replacement manually)

<f:format.html parseFuncTSPath="">{content -> f:format.raw()}</f:format.html>

to

{content -> f:transform.link() -> f:sanitize.html(build: 'default')}
// it also would be possible to define a custom HtmlSanitizer builder for e.g. sys_news, or reports, or ...

Reviews 1

Subtasks 2