Project

General

Profile

Actions

Bug #102392

open

YouTubeRenderer breaks on boolen html attribute without value

Added by Henrik Elsner 6 months ago. Updated 4 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
-
Target version:
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

Bildschirmfoto 2023-11-17 um 10.09.31.png (145 KB) Bildschirmfoto 2023-11-17 um 10.09.31.png Sentry section of the error Henrik Elsner, 2023-11-17 09:09
Actions

Also available in: Atom PDF