Fix #142 - Escape ILIKE special characters from Account.find_remote
This commit is contained in:
parent
20aa777c58
commit
8152584cf5
2 changed files with 43 additions and 3 deletions
|
@ -142,7 +142,7 @@ class Account < ApplicationRecord
|
|||
end
|
||||
|
||||
def find_remote!(username, domain)
|
||||
where(arel_table[:username].matches(username)).where(domain.nil? ? { domain: nil } : arel_table[:domain].matches(domain)).take!
|
||||
where(arel_table[:username].matches(username.gsub(/[%_]/, '\\\\\0'))).where(domain.nil? ? { domain: nil } : arel_table[:domain].matches(domain.gsub(/[%_]/, '\\\\\0'))).take!
|
||||
end
|
||||
|
||||
def find_local(username)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue