Open 4rthem opened 1 year ago
API Platform version(s) affected: 3.0.4
Description
If you pass array of array in query, the next page got from IriHelper is not correct.
How to reproduce
Call your API endpoint with multi-dimensional array params:
GET https://my-api/objects?filters[0][a]=foo&filters[0][b]=bar
In PHP we can access filters[0]['a'] and filters[0]['b']
filters[0]['a']
filters[0]['b']
But the next URL from hydra response is something like:
https://my-api/objects?page=2&filters[][a]=foo&filters[][b]=bar
So in PHP the filters structure is altered and filters[0]['b'] is not defined.
filters
Possible Solution
Remove preg_replace('/%5B\d+%5D/', '%5B%5D', $query) from IriHelper::createIri.
preg_replace('/%5B\d+%5D/', '%5B%5D', $query)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
API Platform version(s) affected: 3.0.4
Description
If you pass array of array in query, the next page got from IriHelper is not correct.
How to reproduce
Call your API endpoint with multi-dimensional array params:
In PHP we can access
filters[0]['a']
andfilters[0]['b']
But the next URL from hydra response is something like:
So in PHP the
filters
structure is altered andfilters[0]['b']
is not defined.Possible Solution
Remove
preg_replace('/%5B\d+%5D/', '%5B%5D', $query)
from IriHelper::createIri.