Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement on convertSearchToArray function #1632

Open
mikenuguid opened this issue Dec 8, 2023 · 2 comments
Open

Enhancement on convertSearchToArray function #1632

mikenuguid opened this issue Dec 8, 2023 · 2 comments

Comments

@mikenuguid
Copy link
Contributor

In general this is not a bug but can be an issue under the right circumstances.

I encountered this while working on the Report admin where a request parameter involving multiple values always return a single param value.

The root cause can be traced on the convertSearchToArray. It seems that using identical keys with unique values get overwritten while looping through all the parts.

For example, if I have a this raw search string ?key=value1&key=value2&anotherKey=value3, what I will end up getting will be ?key=value2&anotherKey=value3 since value2 has identical key as value1

I have created a fix for it and can create a pull request.

@emteknetnz
Copy link
Member

Sounds like a bug could you please link your pull-request

@GuySartorelli
Copy link
Member

If a key should support multiple values, it should be passed using PHP query string array syntax (I'm not sure what it's called), e.g:

?key[]=value1&key[]=value2&anotherKey=value3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants