mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 07:49:29 +00:00
Fix empty query sent to postgres for custom emojis (#5121)
This commit is contained in:
@@ -33,7 +33,11 @@ class CustomEmoji < ApplicationRecord
|
||||
class << self
|
||||
def from_text(text, domain)
|
||||
return [] if text.blank?
|
||||
shortcodes = text.scan(SCAN_RE).map(&:first)
|
||||
|
||||
shortcodes = text.scan(SCAN_RE).map(&:first).uniq
|
||||
|
||||
return [] if shortcodes.empty?
|
||||
|
||||
where(shortcode: shortcodes, domain: domain)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user