From d0a4bc636f39e3dfd209d855e28657e731e7d9cd Mon Sep 17 00:00:00 2001 From: Ghassan Maslamani Date: Thu, 30 Jun 2022 19:13:25 +0300 Subject: [PATCH] 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 --- lib/onebox/engine/vimeo_onebox.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/onebox/engine/vimeo_onebox.rb b/lib/onebox/engine/vimeo_onebox.rb index 16ddb2589b0..b9b689c90c3 100644 --- a/lib/onebox/engine/vimeo_onebox.rb +++ b/lib/onebox/engine/vimeo_onebox.rb @@ -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