DG IZ; escape regex characters in Person.search
This commit is contained in:
parent
9787c45159
commit
fb2f027b24
1 changed files with 1 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ class Person
|
|||
/^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix
|
||||
|
||||
def self.search(query)
|
||||
query = query.to_s.strip
|
||||
query = Regexp.escape( query.to_s.strip )
|
||||
Person.all('profile.first_name' => /^#{query}/i) | Person.all('profile.last_name' => /^#{query}/i)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue