From 1309661b15b05e487dea1c715689a6c152c186d4 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 24 Nov 2016 20:23:42 +0000 Subject: [PATCH] Use image_url instead of image_path with the host option Fixes #1379 --- app/helpers/open_graph_helper.rb | 4 ++-- app/views/changeset/list.atom.builder | 6 +++--- app/views/diary_entry/rss.rss.builder | 2 +- app/views/trace/georss.rss.builder | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/open_graph_helper.rb b/app/helpers/open_graph_helper.rb index e21a5648a..ac1a57219 100644 --- a/app/helpers/open_graph_helper.rb +++ b/app/helpers/open_graph_helper.rb @@ -4,8 +4,8 @@ module OpenGraphHelper "og:site_name" => t("layouts.project_name.title"), "og:title" => [t("layouts.project_name.title"), title].compact.join(" | "), "og:type" => "website", - "og:image" => image_path("osm_logo_256.png", :host => SERVER_URL, :protocol => "http"), - "og:image:secure_url" => image_path("osm_logo_256.png", :host => SERVER_URL, :protocol => "https"), + "og:image" => image_url("osm_logo_256.png", :protocol => "http"), + "og:image:secure_url" => image_url("osm_logo_256.png", :protocol => "https"), "og:url" => url_for(:host => SERVER_URL), "og:description" => t("layouts.intro_text") } diff --git a/app/views/changeset/list.atom.builder b/app/views/changeset/list.atom.builder index 787141389..68b4a1985 100644 --- a/app/views/changeset/list.atom.builder +++ b/app/views/changeset/list.atom.builder @@ -5,12 +5,12 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, feed.title changeset_list_title(params, @user) feed.updated @edits.map { |e| [e.created_at, e.closed_at].max }.max - feed.icon image_path("favicon.ico", :host => SERVER_URL) - feed.logo image_path("mag_map-rss2.0.png", :host => SERVER_URL) + feed.icon image_url("favicon.ico") + feed.logo image_url("mag_map-rss2.0.png") feed.rights :type => "xhtml" do |xhtml| xhtml.a :href => "http://creativecommons.org/licenses/by-sa/2.0/" do |a| - a.img :src => image_path("cc_button.png", :host => SERVER_URL), :alt => "CC by-sa 2.0" + a.img :src => image_url("cc_button.png"), :alt => "CC by-sa 2.0" end end diff --git a/app/views/diary_entry/rss.rss.builder b/app/views/diary_entry/rss.rss.builder index 8a6915bf1..6d1b1def4 100644 --- a/app/views/diary_entry/rss.rss.builder +++ b/app/views/diary_entry/rss.rss.builder @@ -9,7 +9,7 @@ xml.rss("version" => "2.0", xml.description @description xml.link url_for(:action => "list", :host => SERVER_URL) xml.image do - xml.url image_path("mag_map-rss2.0.png", :host => SERVER_URL) + xml.url image_url("mag_map-rss2.0.png") xml.title @title xml.width "100" xml.height "100" diff --git a/app/views/trace/georss.rss.builder b/app/views/trace/georss.rss.builder index 6d3aeebe0..8470e85cb 100644 --- a/app/views/trace/georss.rss.builder +++ b/app/views/trace/georss.rss.builder @@ -10,7 +10,7 @@ xml.rss("version" => "2.0", xml.link url_for(:controller => :trace, :action => :list, :only_path => false) xml.image do - xml.url image_path("mag_map-rss2.0.png", :host => SERVER_URL) + xml.url image_url("mag_map-rss2.0.png") xml.title t("trace.georss.title") xml.width 100 xml.height 100 -- 2.43.2