diff --git a/app/models/custom_emoji.rb b/app/models/custom_emoji.rb index 550f005d59..1c9b443959 100644 --- a/app/models/custom_emoji.rb +++ b/app/models/custom_emoji.rb @@ -86,7 +86,7 @@ class CustomEmoji < ApplicationRecord end def search(shortcode) - where('"custom_emojis"."shortcode" ILIKE ?', "%#{shortcode}%") + where(arel_table[:shortcode].matches("%#{sanitize_sql_like(shortcode)}%")) end end