Commit 0e0524b5 authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[BUGFIX] Use proper regexp for Vimeo URLs in online media helper

The change for issue #94357 introduced handling for `event/` URLs,
and accidentally modified handling for `video/` URLs as well. As a
result, the `video/` IDs were incorrectly resolved containing a
leading slash.

Resolves: #96509
Releases: main, 11.5, 10.4
Change-Id: I5623ff59dac44a699877e4e5a2e91707f72a407e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72967

Reviewed-by: Mathias Brodala's avatarMathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Jigal van Hemert's avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: Jigal van Hemert's avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
parent 48d5c96b
......@@ -73,7 +73,7 @@ class VimeoHelper extends AbstractOEmbedHelper
// - vimeo.com/<code>/<optionalPrivateCode> # Share URL
// - vimeo.com/event/<code>
// - player.vimeo.com/video/<code>/<optionalPrivateCode> # URL form iframe embed code, can also get code from full iframe snippet
if (preg_match('/vimeo\.com\/(?:video|event\/)?([0-9a-z\/]+)/i', $url, $matches)) {
if (preg_match('/vimeo\.com\/(?:video\/|event\/)?([0-9a-z\/]+)/i', $url, $matches)) {
$videoId = $matches[1];
}
if (empty($videoId)) {
......
......@@ -80,6 +80,8 @@ class VimeoHelperTest extends UnitTestCase
['https://typo3.org/', null, null],
['https://vimeo.com/', '7215347324', $fileResourceMock],
['https://vimeo.com/', '7215347324/hasf8a65sdsa7d', $fileResourceMock],
['https://vimeo.com/video/', '7215347324', $fileResourceMock],
['https://vimeo.com/video/', '7215347324/hasf8a65sdsa7d', $fileResourceMock],
['https://player.vimeo.com/', '7215347324', $fileResourceMock],
['https://player.vimeo.com/', '7215347324/hasf8a65sdsa7d', $fileResourceMock],
['https://vimeo.com/event/', '7215347324', $fileResourceMock],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment