-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Description
API Platform version(s) affected: master
Description
Searched strings are not properly escaped before being used in Mongodb regular expressions.
How to reproduce
I have an entry containing a string with parentheses (let's say it's foo(bar)
)in Mongodb, and it appears that I have to escape that string in my HTTP query if I want to find that entry:
http://my.host/my/entities?myField=foo(bar)
yields no results, but
http://my.host/my/entities?myField=foo\(bar\)
yields all the results expected by performing the first query.
Possible Solution
SearchFilter::addEqualityMatchStrategy() should escape strings before concatenating them to form a regular expression.