From c7741c96222be1e7badae152cc01b25ab3a3972e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 12 Dec 2013 17:24:00 +0100 Subject: [PATCH] FIX: absolute canonical link on topic pages --- app/controllers/topics_controller.rb | 4 +++- lib/canonical_url.rb | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index b8f5572981d..54625b51d55 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -1,7 +1,9 @@ require_dependency 'topic_view' require_dependency 'promotion' +require_dependency 'url_helper' class TopicsController < ApplicationController + include UrlHelper before_filter :ensure_logged_in, only: [:timings, :destroy_timings, @@ -57,7 +59,7 @@ class TopicsController < ApplicationController perform_show_response - canonical_url @topic_view.canonical_path + canonical_url absolute(@topic_view.canonical_path) end def wordpress diff --git a/lib/canonical_url.rb b/lib/canonical_url.rb index 0612c665010..6a159091393 100644 --- a/lib/canonical_url.rb +++ b/lib/canonical_url.rb @@ -12,7 +12,6 @@ module CanonicalURL module Helpers def canonical_link_tag(url = nil) - return '' unless url || @canonical_url tag('link', rel: 'canonical', href: url || @canonical_url || request.url) end