mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
FIX: use absolute URL for open graph image tags
This commit is contained in:
parent
4fdfeb45d6
commit
290708ca53
1 changed files with 2 additions and 0 deletions
|
@ -129,6 +129,8 @@ module ApplicationHelper
|
||||||
if opts[:image].present? && opts[:image].start_with?("//")
|
if opts[:image].present? && opts[:image].start_with?("//")
|
||||||
uri = URI(Discourse.base_url)
|
uri = URI(Discourse.base_url)
|
||||||
opts[:image] = "#{uri.scheme}:#{opts[:image]}"
|
opts[:image] = "#{uri.scheme}:#{opts[:image]}"
|
||||||
|
elsif opts[:image].present? && opts[:image].start_with?("/uploads/")
|
||||||
|
opts[:image] = "#{Discourse.base_url}#{opts[:image]}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add opengraph tags
|
# Add opengraph tags
|
||||||
|
|
Loading…
Reference in a new issue