FIX: Vimeo regex pattern (#17277)

Vimeo has two url structure:

- Normal /video_id

- Private/Unlisted /video_id/hash_string

This changes change the regex pattern thus it would be able to

catch both. Also it tolerate trailing slash.

This shall fixes:

https://meta.discourse.org/t/vimeo-embed-urls-parsed-incorrectly-in-email/231042
This commit is contained in:
Ghassan Maslamani 2022-06-30 19:13:25 +03:00 committed by GitHub
parent f130ec35d9
commit d0a4bc636f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ module Onebox
include Engine
include StandardEmbed
matches_regexp(/^https?:\/\/(www\.)?vimeo\.com\/\d+/)
matches_regexp(/^https?:\/\/(www\.)?vimeo\.com\/\d+(\/\w+)?\/?/)
requires_iframe_origins "https://player.vimeo.com"
always_https