mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Allow link redirects inside oneboxed posts
This commit is contained in:
@@ -22,7 +22,11 @@ class TopicLinkClick < ActiveRecord::Base
|
||||
# If no link is found, return the url for relative links
|
||||
unless link.present?
|
||||
return args[:url] if args[:url] =~ /^\//
|
||||
return nil
|
||||
|
||||
# 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.where(url: args[:url]).first
|
||||
return link.present? ? link.url : nil
|
||||
end
|
||||
|
||||
return args[:url] if (args[:user_id] && (link.user_id == args[:user_id]))
|
||||
|
||||
Reference in New Issue
Block a user