diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index 37d7b656dde..d7691db82d2 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -57,7 +57,8 @@ 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')") + # note that ILIKE means "case insensitive LIKE" + builder.where("NOT(ftl.url ILIKE '%.png' OR ftl.url ILIKE '%.jpg' OR ftl.url ILIKE '%.gif')") builder.where("COALESCE(ft.archetype, 'regular') <> :archetype", archetype: Archetype.private_message) builder.secure_category(guardian.secure_category_ids)