Bug #89147

Media additionalConfig no-cookie attribute is added to video tags

Added by Jarvis H 9 days ago. Updated 3 days ago.

Status:
New
Priority:
Should have
Assignee:
Category:
Fluid Styled Content
Target version:
-
Start date:
2019-09-11
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Description:

Typo3 version: 9.5.9

no-cookie attribute is added to <video> tags causing html validation errors

How to reproduce:

Add a media element using an mp4 video file.

Suspected cause:

The 'no-cookie' attribute is used for embedded youtube videos and is set via typoscript like this:

lib.contentElement.settings.media.additionalConfig.no-cookie = 1

which causes output like this:

<video controls no-cookie>...</video>

In the \TYPO3\CMS\Core\Resource\Rendering\VideoTagRenderer class we see that all values found in additionalConfig are added as attributes in addition to all values from additionalAttributes

if (isset($options['additionalConfig']) && is_array($options['additionalConfig'])) {
    foreach ($options['additionalConfig'] as $key => $value) {
        if ((bool)$value) {
            $attributes[] = htmlspecialchars($key);
        }
    }
}

Possible solution:

The above lines could be removed entirely, as additionalAttributes are already available.

History

#1 Updated by Guido Schmechel 3 days ago

The same problem exists with the new "api" setting in the master.

The question is: Does anyone use the typoscript setting for special attributes? Then removing the entire query would be a breaking change.

My suggestion: We remove "no-cookie" and "api" from the array within the VideoTagRenderer.

#2 Updated by Jarvis H 3 days ago

Technically yes, it would be a breaking change, perhaps better suited for Typo3 v10.

I agree with your idea to remove the attributes as you suggested, temporarily solving it like that for Typo3 v9.

Also available in: Atom PDF