diff --git a/app/models/topic_link_click.rb b/app/models/topic_link_click.rb index 0d21734362d..68a03d8835e 100644 --- a/app/models/topic_link_click.rb +++ b/app/models/topic_link_click.rb @@ -19,7 +19,12 @@ class TopicLinkClick < ActiveRecord::Base link = link.where(topic_id: args[:topic_id]) if args[:topic_id].present? link = link.first - return unless link.present? + # If no link is found, return the url for relative links + unless link.present? + return args[:url] if args[:url] =~ /^\// + return nil + end + return args[:url] if (args[:user_id] && (link.user_id == args[:user_id]))