Skip to content

Commit

Permalink
Escape %_ using ActiveRecord::Sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed May 28, 2018
1 parent 91f2abb commit d11355b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/search_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.parse_search_params(params, symbol, user)
regex_support.each { |k, v| input = input.gsub(k, v) }
else
operation = 'LIKE'
input = '%' + input + '%'
input = '%' + ActiveRecord::Base.sanitize_sql_like(input) + '%'
end

[input, operation]
Expand Down

0 comments on commit d11355b

Please sign in to comment.