mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 04:29:29 +08:00
FIX: tags canonical url can raise error or be wrong
This commit is contained in:
parent
7c8095294d
commit
685e6bdbab
|
@ -66,7 +66,8 @@ class TagsController < ::ApplicationController
|
|||
@description_meta = I18n.t("rss_by_tag", tag: tag_params.join(' & '))
|
||||
@title = @description_meta
|
||||
|
||||
canonical_url "#{Discourse.base_url_no_prefix}#{public_send(url_method(params.slice(:category, :parent_category)))}"
|
||||
path_name = url_method(params.slice(:category, :parent_category))
|
||||
canonical_url "#{Discourse.base_url_no_prefix}#{public_send(path_name, *(params.slice(:parent_category, :category, :tag_id).values))}"
|
||||
|
||||
if @list.topics.size == 0 && params[:tag_id] != 'none' && !Tag.where(name: @tag_id).exists?
|
||||
permalink_redirect_or_not_found
|
||||
|
|
Loading…
Reference in New Issue
Block a user