FIX: use absolute URL for open graph image tags

This commit is contained in:
Arpit Jalan 2015-11-03 01:23:51 +05:30
parent 4fdfeb45d6
commit 290708ca53

View file

@ -129,6 +129,8 @@ module ApplicationHelper
if opts[:image].present? && opts[:image].start_with?("//")
uri = URI(Discourse.base_url)
opts[:image] = "#{uri.scheme}:#{opts[:image]}"
elsif opts[:image].present? && opts[:image].start_with?("/uploads/")
opts[:image] = "#{Discourse.base_url}#{opts[:image]}"
end
# Add opengraph tags