From 290708ca535b63970424dbc80f045435ee79380c Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 3 Nov 2015 01:23:51 +0530 Subject: [PATCH] FIX: use absolute URL for open graph image tags --- app/helpers/application_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5b1a863f2..022141a73 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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