mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 02:58:48 +08:00
FIX: Users with unicode usernames unable to load more topics in activity (#16627)
This was due to a server side bug when unicode usernames have been enabled. We were double encoding the unicode username in the URL resulting in a invalid URL.
This commit is contained in:

committed by
GitHub

parent
aa343d506f
commit
8271828948
@ -424,12 +424,21 @@ class ListController < ApplicationController
|
||||
end
|
||||
|
||||
opts = opts.dup
|
||||
|
||||
if SiteSetting.unicode_usernames && opts[:group_name]
|
||||
opts[:group_name] = UrlHelper.encode_component(opts[:group_name])
|
||||
end
|
||||
|
||||
opts.delete(:category) if page_params.include?(:category_slug_path_with_id)
|
||||
|
||||
public_send(method, opts.merge(page_params)).sub('.json?', '?')
|
||||
url = public_send(method, opts.merge(page_params)).sub('.json?', '?')
|
||||
|
||||
# Unicode usernames need to be encoded when calling Rails' path helper. However, it means that the already
|
||||
# encoded username are encoded again which we do not want. As such, we unencode the url once when unicode usernames
|
||||
# have been enabled.
|
||||
url = UrlHelper.unencode(url) if SiteSetting.unicode_usernames
|
||||
|
||||
url
|
||||
end
|
||||
|
||||
def ensure_can_see_profile!(target_user = nil)
|
||||
|
Reference in New Issue
Block a user