Skip to content

Commit

Permalink
[BUGFIX] Allow to include YouTube shorts
Browse files Browse the repository at this point in the history
Kudos to Georg Ringer for the hint.

Resolves: #98600
Releases: main, 12.4, 11.5
Change-Id: I1c200b4a8835bdccc4e9dc2cf2cee423459a13c4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79746
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
bmack authored and o-ba committed Jul 5, 2023
1 parent 5289e58 commit 774f58a
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -78,7 +78,8 @@ public function transformUrlToFile($url, Folder $targetFolder)
// - www.youtube.com/v/<code>
// - www.youtube-nocookie.com/v/<code> # youtube-nocookie.com web link
// - www.youtube.com/embed/<code> # URL form iframe embed code, can also get code from full iframe snippet
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) {
// - www.youtube.com/shorts/<code>
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?|shorts)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) {
$videoId = $match[1];
}
if (empty($videoId)) {
Expand Down

0 comments on commit 774f58a

Please sign in to comment.