mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Could not download exported data on some sites
This commit is contained in:
@@ -31,6 +31,12 @@ class TopicLinkClick < ActiveRecord::Base
|
||||
unless link.present?
|
||||
return args[:url] if args[:url] =~ /^\//
|
||||
|
||||
begin
|
||||
uri = URI.parse(args[:url])
|
||||
return args[:url] if uri.host == URI.parse(Discourse.base_url).host
|
||||
rescue
|
||||
end
|
||||
|
||||
# If we have it somewhere else on the site, just allow the redirect. This is
|
||||
# likely due to a onebox of another topic.
|
||||
link = TopicLink.find_by(url: args[:url])
|
||||
|
||||
Reference in New Issue
Block a user