Skip to content

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

Open
@finwe

Description

@finwe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions