diff --git a/typo3/sysext/core/Classes/Resource/Rendering/VimeoRenderer.php b/typo3/sysext/core/Classes/Resource/Rendering/VimeoRenderer.php index 8dd6aed10b1c90e1041f3c9c47617d17107b8361..274b93ce53318ecb365fc87e6129a6605c25481f 100644 --- a/typo3/sysext/core/Classes/Resource/Rendering/VimeoRenderer.php +++ b/typo3/sysext/core/Classes/Resource/Rendering/VimeoRenderer.php @@ -119,10 +119,10 @@ class VimeoRenderer implements FileRendererInterface $src = sprintf('https://player.vimeo.com/video/%s?%s', $videoId, implode('&', $urlParams)); $attributes = ['allowfullscreen']; - if (is_array($options['additionalAttributes'])) { + if (isset($options['additionalAttributes']) && is_array($options['additionalAttributes'])) { $attributes[] = GeneralUtility::implodeAttributes($options['additionalAttributes'], true, true); } - if (is_array($options['data'])) { + if (isset($options['data']) && is_array($options['data'])) { array_walk($options['data'], function (&$value, $key) { $value = 'data-' . htmlspecialchars($key) . '="' . htmlspecialchars($value) . '"'; }); @@ -134,7 +134,7 @@ class VimeoRenderer implements FileRendererInterface if ((int)$height > 0) { $attributes[] = 'height="' . (int)$height . '"'; } - if (is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->config['config']['doctype'] !== 'html5') { + if (isset($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->config['config']['doctype'] !== 'html5') { $attributes[] = 'frameborder="0"'; } foreach (['class', 'dir', 'id', 'lang', 'style', 'title', 'accesskey', 'tabindex', 'onclick'] as $key) { diff --git a/typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php b/typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php index f1be8c8fc75304e9bd0a5bac5046a02a19c04aeb..dfefbed2809127008e36b6bfe0185a1ce0d11382 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php @@ -1,4 +1,5 @@ <?php +declare(strict_types = 1); namespace TYPO3\CMS\Core\Tests\Unit\Resource\Rendering; /* @@ -18,17 +19,13 @@ use TYPO3\CMS\Core\Resource\File; use TYPO3\CMS\Core\Resource\FileReference; use TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\VimeoHelper; use TYPO3\CMS\Core\Resource\Rendering\VimeoRenderer; +use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** * Class VimeoRendererTest */ -class VimeoRendererTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase +class VimeoRendererTest extends UnitTestCase { - /** - * Subject is not notice free, disable E_NOTICES - */ - protected static $suppressNotices = true; - /** * @var VimeoRenderer|\PHPUnit_Framework_MockObject_MockObject */