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

[11.x] Enhance URI query string manipulation #53805

Conversation

hafezdivandari
Copy link
Contributor

@hafezdivandari hafezdivandari commented Dec 9, 2024

Related to #53731

A query string parameter key may contain a dot, and manipulating the query string with methods that support "dot" notation makes the current implementation buggy. This PR adds two tests that demonstrate the issue.

This PR:

  • Moves the logic for query string manipulation from the Uri class to the UriQueryString class.
  • Fixes the issue with manipulating query parameters that have dots in their keys.

There’s room for improvement in this PR. Please mark it as a draft if you think the general approach is heading in the right direction. Any feedback is appreciated. Thanks!

@taylorotwell
Copy link
Member

I don't want to move the manipulation stuff into the query parameters class. I want it to stay in the URI class.

The dot notation stuff was intentional, though I'm not 100% confident it is the right approach. It makes it easy to dig into array based query strings... and it makes it consistent with how $request->input works as well as $request->has, $request->missing, etc. since both share the InteractsWithData trait.

@hafezdivandari hafezdivandari deleted the 11.x-enhance-uri-query-string branch December 11, 2024 07:05
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

Successfully merging this pull request may close these issues.

2 participants