FIX: Fallback when embedding YouTube videos with lazy videos (#30514)

This commit is contained in:
Jan Cernik 2025-01-03 08:55:40 -03:00 committed by GitHub
parent 91f7ae2741
commit bba4c9b005
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,8 @@ class Onebox::Engine::YoutubeOnebox
thumbnail_url = result[:image]
end
return default_onebox_to_html if video_title.chomp("- YouTube").blank? || thumbnail_url.blank?
escaped_title = ERB::Util.html_escape(video_title)
escaped_start_time = ERB::Util.html_escape(params["t"])
t_param = "&t=#{escaped_start_time}" if escaped_start_time.present?