FIX: in some cases link was not followable due to click tracker

This commit is contained in:
Sam 2015-05-06 11:22:53 +10:00
parent 6fab03b777
commit 0bbf6354eb
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ class TopicLinkClick < ActiveRecord::Base
link = TopicLink.find_by(url: url)
return link.url if link.present?
return nil unless uri
# Only redirect to whitelisted hostnames
return WHITELISTED_REDIRECT_HOSTNAMES.include?(uri.hostname) ? url : nil
end