Actions
Bug #102392
openYouTubeRenderer breaks on boolen html attribute without value
Start date:
2023-11-17
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Error message:
`PHP Runtime Deprecation Notice: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/typo3/cms-core/Classes/Resource/Rendering/YouTubeRenderer.php line 236`
Example code:
<f:media class="video-embed-item" file="{file}" alt="{file.alternative}" title="{file.title}"
additionalAttributes="{playsinline:null, poster: posterimage}"/>
The playsinline attribute is without value thus causing the YouTubeRenderer to fail on evaulating.
IMHO it should be supported to handle the value = null
One could argue, that we should set playsinline to true, which then only sets the attribute name, but for the poster attribute in this case we would have to evaluate the posterimage object each time which can be annoying and expanding the code unnecessarily
Files
Actions