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

Multiple GET parameters of same name dropped from parsed query #178

Open
finwe opened this issue Apr 17, 2020 · 1 comment
Open

Multiple GET parameters of same name dropped from parsed query #178

finwe opened this issue Apr 17, 2020 · 1 comment
Milestone

Comments

@finwe
Copy link

finwe commented Apr 17, 2020

When creating a Nette\Http\Url object from a query with multiple GET parameters of a same name, only the last one is kept.

There is no standard regarding query parameters of the same name, many sites and tools, especially outside PHP world use the notation with multiple parameters of the same name. It'd be nice if Nette Url could correctly interpret these.

Steps To Reproduce

$url = new \Nette\Http\Url('https://www.example.com?filters=color-lightblue&filters=color-blue&filters=color-turquoise');
dump($url->getQuery()); // is ['filters' => 'color-turquoise']

Expected Behavior

The query property of the URL object should be an array of all three filters GET values, the same way as if filters[] notation were used.

Needs to be addressed

I see there is a potential of a BC break and maybe generating a URL string the same way - choosing the notation, maybe by setting a flag.

@dg dg added this to the v4.0 milestone Feb 6, 2021
@dg
Copy link
Member

dg commented Apr 2, 2022

I think the behavior should be the same as how PHP itself accesses the query parameters.

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

No branches or pull requests

2 participants