[英]TYPO3 fluid: f:format.html in backend removes links
I am using flux 9.5.0 in TYPO3 9.5.31 to create a simle "text" content element.我在 TYPO3 9.5.31 中使用 flux 9.5.0 创建一个简单的“文本”内容元素。
It has a preview section that is displayed in the TYPO3 backend with <f:format.html> :它有一个预览部分,显示在 TYPO3 后端,带有<f:format.html> :
<f:section name="Preview">
<f:format.html>{settings.text}</f:format.html>
</f:section>
Unfortunately, links get removed and are not even their text displayed.不幸的是,链接被删除,甚至不显示其文本。
Example:例子:
<p>before <a href="https://cweiske.de/" target="_blank">link</a> after</p>
RTE 中的 HTML: <p>before <a href="https://cweiske.de/" target="_blank">link</a> after</p>
before after
在预览中呈现 output: before after
How can I get the links in the preview section rendered?如何获得呈现的预览部分中的链接?
There was a change in version 9.5.29 due to security reasons.出于安全原因,版本 9.5.29 发生了变化。
See: https://typo3.org/security/advisory/typo3-core-sa-2021-013请参阅: https://typo3.org/security/advisory/typo3-core-sa-2021-013
How to fix: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/9.5.x/Important-94484-IntroduceHTMLSanitizer.html如何修复: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/9.5.x/Important-94484-IntroduceHTMLSanitizer.html
This is a problem with TYPO3's fluid.这是TYPO3的油液有问题。
TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::simulateFrontendEnvironment()
creates a dummy TSFE instance. TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::simulateFrontendEnvironment()
创建一个虚拟 TSFE 实例。
TYPO3's ContentObjectRenderer
expects $TSFE->cObjectDepthCounter
to be > 0 when rendering nested tags in cObjGetSingle
, and this fails because the dummy TSFE instance does not have this variable set. TYPO3 的ContentObjectRenderer
在cObjGetSingle
中呈现嵌套标签时期望$TSFE->cObjectDepthCounter
> 0,这失败了,因为虚拟 TSFE 实例没有设置此变量。
This problem is known since 2015: Bug #66855: Format/HtmlViewHelper don't render Links in TYPO3_MODE = BE自 2015 年以来已知此问题:错误 #66855:Format/HtmlViewHelper 不呈现 TYPO3_MODE = BE 中的链接
According to https://forge.typo3.org/issues/67556 and https://forge.typo3.org/issues/96535 this is "fixed" in TYPO3 v11.5 if you switch to <f:transform.html>
.根据https://forge.typo3.org/issues/67556和https: //forge.typo3.org/issues/96535 如果您切换到<f:transform.html>
,这将在 TYPO3 v11.5 中“修复” .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.