Skip to content

[3.x] Use RFC3986 for building URI query strings #906

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

Merged
merged 1 commit into from
Aug 11, 2020
Merged

[3.x] Use RFC3986 for building URI query strings #906

merged 1 commit into from
Aug 11, 2020

Conversation

GrahamCampbell
Copy link
Contributor

No description provided.

Copy link
Collaborator

@acrobat acrobat left a comment

Choose a reason for hiding this comment

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

I have 2 questions here. Why is this preferred over the default? And can you already apply this to the 2.x branch?

@GrahamCampbell
Copy link
Contributor Author

GrahamCampbell commented Jul 16, 2020

The default (PHP_QUERY_RFC1738) is actually what's meant to be used to build request bodies of application/x-www-form-urlencoded, and not query strings for URIs. This is another blunder in the PHP naming of functions. RFC3986 is the (only) specification for query strings, and it should have been used always (though it only differs in a couple of edge cases, so people probably didn't notice things going wrong). :P

@acrobat
Copy link
Collaborator

acrobat commented Jul 16, 2020

That's clear, thanks for the explanation! 😄 Can you target the 2.x branch so we can already avoid these edge cases in v2!

@GrahamCampbell
Copy link
Contributor Author

The reason I didn't originally target v2 was in case people had already worked around these edge cases themselves, and they find their work around break when we change the encoding. I can still send to 2.x if you want though. :)

@GrahamCampbell GrahamCampbell changed the title Use RFC3986 for building URI query strings [3.x] Use RFC3986 for building URI query strings Jul 16, 2020
acrobat pushed a commit that referenced this pull request Aug 11, 2020
…bell)

This PR was squashed before being merged into the 2.x branch.

Discussion
----------

#906, but for 2.x.

Commits
-------

1530c3f Update Authentication.php
6df6b9e Update AbstractApi.php
@acrobat acrobat merged commit c6e60d3 into KnpLabs:master Aug 11, 2020
@acrobat
Copy link
Collaborator

acrobat commented Aug 11, 2020

Thank you @GrahamCampbell

@GrahamCampbell GrahamCampbell deleted the patch-1 branch August 11, 2020 19:25
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