Browse Source

Use Arel `matches` method in CustomEmoji search (#28615)

Matt Jankowski 4 months ago
parent
commit
e827c4692c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/models/custom_emoji.rb

+ 1 - 1
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