diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index 12ae7dcaab0..0669f786765 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -57,6 +57,7 @@ SQL builder.where('ftl.topic_id = :topic_id', topic_id: topic_id) builder.where('ft.deleted_at IS NULL') + builder.where("NOT(ftl.url LIKE '%.png' OR ftl.url LIKE '%.jpg' OR ftl.url LIKE '%.gif')") builder.where("COALESCE(ft.archetype, 'regular') <> :archetype", archetype: Archetype.private_message) builder.secure_category(guardian.secure_category_ids)