Issue Bug Closed

#87529AbstractOEmbedHelper::transformMediaIdToFile() must check if $oEmbed['title'] is set before using it.

Leonie Philine 01/23/19, 19:40 updated 05/07/19, 12:13

Description

This bug is one of the two little sidekicks of https://forge.typo3.org/issues/87528.

In TYPO3 8 AND 9, \TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\AbstractOEmbedHelper::transformMediaIdToFile() contains the following passage:

            $oEmbed = $this->getOEmbedData($mediaId);
            if (!empty($oEmbed)) {
                $fileName = $oEmbed['title'] . '.' . $fileExtension;
            } else {
                $fileName = $mediaId . '.' . $fileExtension;
            }

Under some circumstances, $oEmbed['title'] is not set – for example for privacy-restricted Vimeo videos due to a missing Referer header; but that’s a separate bug: https://forge.typo3.org/issues/87528 . Despite what’s in #87528, still testing for !empty($oEmbed) and using $oEmbed['title'] is a logical fault. :) So one bug must be fixed independently from the other.

When $oEmbed['title'] is not set, the file will be saved successfully, but as a hidden file, due to its filename “.vimeo”. All further retries fail, because TYPO3 (actually the local driver) “knows” the file is there and acts accordingly, but does not show the file to the user due to the filterHiddenFilesAndFolders default filter.

Therefore, when $oEmbed['title'] is not set then $fileName = $mediaId . '.' . $fileExtension; must be used.

Reviews 2