FIX: Giphy oneboxing when the response is an image (#13199)

This commit is contained in:
Penar Musaraj
2021-05-28 15:10:32 -04:00
committed by GitHub
parent 526dbc99b2
commit 06e1af2b1d
2 changed files with 15 additions and 1 deletions

View File

@@ -11,7 +11,12 @@ module Onebox
def to_html
og = get_opengraph
"<img src='#{og.image}' width='#{og.image_width}' height='#{og.image_height}' class='animated onebox' #{og.title_attr}>"
if og.image
"<img src='#{og.image}' width='#{og.image_width}' height='#{og.image_height}' class='animated onebox' #{og.title_attr}>"
else
escaped_url = ::Onebox::Helpers.normalize_url_for_output(@url)
"<img src='#{escaped_url}' class='animated onebox'>"
end
end
end
end