#69263format.crop ViewHelper breaks inside some tags
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:
<pre>{someRteContent -> f:format.html() -> f:format.crop(maxCharacters: 25)}</pre> - allow
iframetags in the RTE configuration
(I know, I know, bad…. But: even default, “good” tags likearticleare broken) - have an Editor place an
iframetag at the affected crop position
Lets assume, the editor embeds a YouTube video there:
<pre> <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></pre>
Expected result
<pre>
<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></pre>
Actual result
<pre>
<h1>Big buck bunny</h1>
<iframe w...</pre>
This is obviously invalid html, effectively “hiding” any later output (using typical rendering engines).