Bug #69263
closedformat.crop ViewHelper breaks inside some tags
100%
Description
The Regex used inside \TYPO3\CMS\Frontent\ContentObject\ContentObjectRenderer->cropHTML()
uses a list of known html tags to do its work. Said list misses a lot of html5 tags. Furthermore, it does not respect <script>
tags (as a @todo
comment says).
How to reproduce: (constructing a bad outcome of this bug)¶
Steps¶
- Use a Fluid template containing this:
{someRteContent -> f:format.html() -> f:format.crop(maxCharacters: 25)}
- allow
iframe
tags in the RTE configuration
(I know, I know, bad…. But: even default, "good" tags likearticle
are broken) - have an Editor place an
iframe
tag at the affected crop position
Lets assume, the editor embeds a YouTube video there:
<h1>Big buck bunny</h1> <iframe width="560" height="315" src="https://www.youtube.com/embed/YE7VzlLtp-4" frameborder="0" allowfullscreen></iframe> <p>Lorem ipsum dolor foo bar</p>
Expected result¶
<h1>Big buck bunny</h1>
<iframe width="560" height="315" src="https://www.youtube.com/embed/YE7VzlLtp-4" frameborder="0" allowfullscreen></iframe>
<p>Lorem ipsum...</p>
Actual result¶
<h1>Big buck bunny</h1>
<iframe w...
This is obviously invalid html, effectively "hiding" any later output (using typical rendering engines).
Updated by Gerrit Code Review about 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42841
Updated by Benni Mack about 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Gerrit Code Review about 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42841
Updated by Gerrit Code Review about 9 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43995
Updated by Ludwig Rafelsberger about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 370e99379c33fd18b5c6de2e8d04dca1270e1237.
Updated by Gerrit Code Review about 9 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43996
Updated by Benni Mack about 9 years ago
- Status changed from Under Review to Resolved
Applied in changeset c378495e916f02350c972d6e065e4b2c7c264e4b.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed