mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Look up a url without the query string if it couldn't be found with it.
This commit is contained in:
@ -8,6 +8,12 @@ class ClicksController < ApplicationController
|
||||
if params[:topic_id].present? || params[:post_id].present?
|
||||
params.merge!({ user_id: current_user.id }) if current_user.present?
|
||||
@redirect_url = TopicLinkClick.create_from(params)
|
||||
|
||||
if @redirect_url.blank? && params[:url].index('?')
|
||||
# Check the url without query parameters
|
||||
params[:url].sub!(/\?.*$/, '')
|
||||
@redirect_url = TopicLinkClick.create_from(params)
|
||||
end
|
||||
end
|
||||
|
||||
# Sometimes we want to record a link without a 302. Since XHR has to load the redirected
|
||||
|
Reference in New Issue
Block a user