Bug #87529

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

Added by Leonie Philine Bitto 4 months ago. Updated 15 days ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2019-01-23
Due date:
% Done:

100%

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

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.

Associated revisions

Revision 95ea7021 (diff)
Added by Susanne Moog 3 months ago

[BUGFIX] Check existence of OEmbed title

Under certain circumstances the title property
of the OEmbed info might be empty, so the check
has been expanded to contain the used property.

Resolves: #87529
Releases: master, 9.5
Change-Id: I1e56f0d91cb6c6f86a5b16f375525b5da30d3f9f
Reviewed-on: https://review.typo3.org/c/59878
Tested-by: TYPO3com <>
Tested-by: Georg Ringer <>
Tested-by: Anja Leichsenring <>
Tested-by: Benni Mack <>
Reviewed-by: Georg Ringer <>
Reviewed-by: Anja Leichsenring <>
Reviewed-by: Benni Mack <>

Revision 12abbffd (diff)
Added by Susanne Moog 3 months ago

[BUGFIX] Check existence of OEmbed title

Under certain circumstances the title property
of the OEmbed info might be empty, so the check
has been expanded to contain the used property.

Resolves: #87529
Releases: master, 9.5
Change-Id: I1e56f0d91cb6c6f86a5b16f375525b5da30d3f9f
Reviewed-on: https://review.typo3.org/c/59900
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59878

#2 Updated by Gerrit Code Review 3 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59900

#3 Updated by Anonymous 3 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Benni Mack 15 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF