Skip to content
Snippets Groups Projects
Commit 3dce6cbb authored by abcang's avatar abcang Committed by Eugen Rochko
Browse files

Fixed duplicating URL of photo type of oEmbed (#5763)

parent 2bcc8170
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,9 @@ class FetchLinkCardService < BaseService ...@@ -74,6 +74,9 @@ class FetchLinkCardService < BaseService
return false unless response.respond_to?(:type) return false unless response.respond_to?(:type)
# The photo will change the URL. So, to avoid duplication of URLs, PreviewCard needs to be checked again.
@card = PreviewCard.find_by(url: response.url) || @card if response.type == 'photo'
@card.type = response.type @card.type = response.type
@card.title = response.respond_to?(:title) ? response.title : '' @card.title = response.respond_to?(:title) ? response.title : ''
@card.author_name = response.respond_to?(:author_name) ? response.author_name : '' @card.author_name = response.respond_to?(:author_name) ? response.author_name : ''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment