mirror of
https://github.com/docusealco/docuseal
synced 2026-11-07 23:32:33 -05:00
escape wildcard query
This commit is contained in:
1 parent
680ab9dbed
commit
34ea639c25
3 files changed
+9
-4
No files matched your search
+3
-1
@@ -52,7 +52,9 @@ module Templates
|
||||
def plain_search(templates, keyword)
|
||||
return templates if keyword.blank?
|
||||
|
||||
templates.where(Template.arel_table[:name].lower.matches("%#{keyword.downcase}%"))
|
||||
sanitized = ActiveRecord::Base.sanitize_sql_like(keyword.downcase)
|
||||
|
||||
templates.where(Template.arel_table[:name].lower.matches("%#{sanitized}%"))
|
||||
end
|
||||
|
||||
def fulltext_search(current_user, templates, keyword)
|
||||
|
||||
Reference in new issue
Block a user