API Platform version(s) affected: 2.2.0 to 2.5.4
Description
We can't filter with a GET parameter that uses a '+' inside the value. For example an email "[email protected]" or a phone number with the region "+33666666666" will convert the value to ""myemail [email protected]" and "33666666666" because of this line
How to reproduce
Currently, I don't have the time to create a reproducer but you just have to use a GET filter with a '+'
Possible Solution
Don't use the method urldecode that considers the + as a space but I don't fully understand all the logic in this class
This is definitely a bug to me, thanks @FabienSalles for the report. This behavior should be customizable at least.
Are you url-encoding the + character? Otherwise it's normal that it's treated as space.
The "+" wasn't effectively encoded. I found this in my functional test without encoding but now my frontend developer use my endpoint with his form filter, the '+' is correctly encoded in "%2B" and the filter works fine.
So the problem was my test. Sorry, I close this issue.
Could definitely be in the documentation :p
Most helpful comment
Are you url-encoding the
+character? Otherwise it's normal that it's treated as space.