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

HttpClient: refactor the way we clean utm_ query params #252

Merged
merged 10 commits into from
Dec 10, 2021

Conversation

Kdecherf
Copy link
Collaborator

The old preg_replace call incorrectly removed the ? of the query string
section which could lead to things like this:

http://example.com/foo?utm_source=a&var=value =>
http://example.com/foo&var=value

@coveralls
Copy link

coveralls commented Jan 23, 2021

Coverage Status

Coverage increased (+0.01%) to 95.315% when pulling 8bcef77 on Kdecherf:fix/utm-query into 1e06a55 on j0k3r:master.

j0k3r and others added 7 commits November 29, 2021 22:44
Also:
- test PHP 8.1
- update to PHPStan@1
- allow symfony/* 6.0
- `strtotime(): Passing null to parameter j0k3r#1 ($datetime) of type string is deprecated`
- `date_parse(): Passing null to parameter j0k3r#1 ($datetime) of type string is deprecated`
@Kdecherf Kdecherf force-pushed the fix/utm-query branch 2 times, most recently from 6dfe4d5 to 1fb0ea3 Compare December 4, 2021 14:23
@Kdecherf Kdecherf requested a review from j0k3r December 4, 2021 14:30
Copy link
Owner

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, you can squash 👍

The old preg_replace call incorrectly removed the ? of the query string
section which could lead to things like this:

  http://example.com/foo?utm_source=a&var=value =>
http://example.com/foo&var=value

Signed-off-by: Kevin Decherf <[email protected]>
As per RFC3986, Section 3.4 indicates that we can avoid percent-encoding
the'/' and '?' characters. However the '=' character in the nested query
string should be encoded.

Signed-off-by: Kevin Decherf <[email protected]>
Uri::withQueryValues() has been added in psr7 1.5.0 but our direct
dependency http-factory-guzzle is currently set to require ^1.4.2 which
could cause issues on some installations.

Signed-off-by: Kevin Decherf <[email protected]>
@j0k3r j0k3r changed the base branch from master to 2.x December 10, 2021 21:25
@j0k3r j0k3r merged commit 574142a into j0k3r:2.x Dec 10, 2021
@j0k3r
Copy link
Owner

j0k3r commented Dec 10, 2021

Sh*t I fucked up the PR when changing the base branch and then merged it 🤦‍♂️
Could you reopen the same PR targeting the 2.x branch without my latest changes from the upcoming 3.0?
So your PR will be part of the next 2.x release and also 3.0.
Thanks and sorry for the extra work..

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.

4 participants