mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
FIX: onebox local topic when using slug-less URL
When linking to a topic in the same Discourse, we try to onebox the link to show the title and other various information depending on whether it's a "standard" or "inline" onebox. However, we were not properly detecting links to topics that had no slugs (eg. https://meta.discourse.org/t/1234).
This commit is contained in:
+1
-3
@@ -219,9 +219,7 @@ module Oneboxer
|
||||
end
|
||||
end
|
||||
|
||||
topic = Topic.find_by(id: route[:topic_id])
|
||||
|
||||
return unless topic
|
||||
return unless topic = Topic.find_by(id: route[:id] || route[:topic_id])
|
||||
return if topic.private_message?
|
||||
|
||||
if current_category.blank? || current_category.id != topic.category_id
|
||||
|
||||
Reference in New Issue
Block a user