mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: should allow non-ASCII slugs for category pages.
This commit is contained in:
@ -348,6 +348,11 @@ class ListController < ApplicationController
|
||||
|
||||
current_slug = params.require(:category_slug_path_with_id)
|
||||
real_slug = @category.full_slug("/")
|
||||
|
||||
if SiteSetting.slug_generation_method == "encoded"
|
||||
current_slug = current_slug.split("/").map { |slug| CGI.escape(slug) }.join("/")
|
||||
end
|
||||
|
||||
if current_slug != real_slug
|
||||
url = request.fullpath.gsub(current_slug, real_slug)
|
||||
return redirect_to path(url), status: 301
|
||||
|
Reference in New Issue
Block a user